Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Social Plugins
  • Facebook Login
  • Open Graph
  • Facebook APIs
  • Games
  • Media
  • Payments
  • App Center
  • Promote Your App
  • iOS
  • Android
  • Web
    • Getting Started
    • JavaScript SDK
    • PHP SDK
    • More SDKs
    • Facebook for WordPress
  • Technology Partners
  • Facebook Object
    • api
    • getAccessToken
    • getApiSecret
    • getAppId
    • getLoginStatusUrl
    • getLoginUrl
    • getLogoutUrl
    • getSignedRequest
    • getUser
    • setAccessToken
    • setApiSecret
    • setAppId
    • setFileUploadSupport
    • useFileUploadSupport
  • FacebookApiException
    • getResult
    • getType

setFileUploadSupport

Web › PHP SDK › setFileUploadSupport

Facebook::setFileUploadSupport($fileUploadSupport)

Set file upload support in the SDK. Your server must be configured to support file uploads in order to use this feature.

You can also set this parameter via the fileUpload property in the $config array when you instantiate the Facebook object.

Example

// Upload a photo to a user’s profile
// Your app needs photo_upload permission for this to work
$facebook->setFileUploadSupport(true);

$img = '/tmp/mypic.png';

$photo = $facebook->api(
  '/me/photos', 
  'POST',
  array(
    'source' => '@' . $img,
    'message' => 'Photo uploaded via the PHP SDK!'
  )
);

Parameters

Name Description
fileUploadSupport Set to true if file uploads are enabled on the server, false otherwise.
Updated about 2 months ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy