Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3243010
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:22:57+00:00 2026-05-17T18:22:57+00:00

I wrote a Facebook app in PHP and need to be able to allow

  • 0

I wrote a Facebook app in PHP and need to be able to allow the user to upload an image to my server. I have used this code:

<?php
include_once('facebook.php');
$appapikey = 'API KEY HERE';
$appsecret = 'SECRET KEY HERE';
$facebook = new Facebook($appapikey, $appsecret);
$fb_user =  $facebook->require_login();

if((!empty($_FILES["uploaded_file"])) && ($_FILES['uploaded_file']['error'] == 0)) {
  $filename = basename($_FILES['uploaded_file']['name']);
  $ext = substr($filename, strrpos($filename, '.') + 1);
  if (($ext == "jpg") && ($_FILES["uploaded_file"]["type"] == "image/jpeg") && 
    ($_FILES["uploaded_file"]["size"] < 350000)) {
      $newname = dirname(__FILE__).'/upload/zbt_'.$fb_user.'.jpg';
      if ((move_uploaded_file($_FILES['uploaded_file']['tmp_name'],$newname))) {
         header("Location: http://majik.zbrowntechnology.info/display.php");
      } else {
         header("Location: home.php?Fatal");
      }
 } else {
     header("Location: home.php?Fatal");
  }
} else {
 header("Location: home.php?Fatal");
}
?>

but am not able to actually save the file in the directory. I have done some playing around with the code and think the problem lies in the moving of the file in this line:

if ((move_uploaded_file($_FILES[‘uploaded_file’][‘tmp_name’],$newname))) {….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:22:58+00:00Added an answer on May 17, 2026 at 6:22 pm

    It is not easy to do with FBML application.

    First – you have to point your form to the script on your domain

    <form enctype="multipart/form-data"
           action="http://your.domain/upload.php"
           method="post" >
    

    Next: on that upload.php you have to handle the uploaded file, process it, do whatever you want and after that you need to redirect back to the your FBML canvas application at facebook.com.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the deal: I have an fb app I wrote mostly for my own
A Facebook app is hosted on my server at, say, http://server.com/projects/fbapp/ , but is
I'm think something like Facebook apps here. User generated pieces of code that people
I wrote a simple Windows Forms program in C#. I want to be able
I'm looking for a javascript version of PHP's html_entity_decode . I found this: function
I'm developing a facebook app right now all by my lonesome. I'm attempting to
Anyone have any tips for best practices for mocking out facebook requests in functional
A Facebook Sync app filled the address fields of my Mac Address Book contacts
Wrote the following in PowersHell as a quick iTunes demonstration: $iTunes = New-Object -ComObject
I wrote a simple batch file as a PowerShell script, and I am getting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.