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

I have a serious problem in my app. I wrote a facebook like instant
I have integrated Facebook into my Android App. When a user now posts a
I just need simple and working facebook app. I bought ssl for this and
I wrote a small Facebook Ap[p in PHP and would like to be able
I have written a app in PHP on my localhost server using XAMP, which
I wrote a Facebook app from PHP and HTML that work perfect in the
I'm trying to write a simple app that lets a user grant my code
I have implemented Facebook connect on my iPhone App to login users to my
Here's the deal: I have an fb app I wrote mostly for my own
I'm doing facebook app, it create a new tab(other for those who likes this

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.