title: Uploading video to Facebook with Facebook iOS SDK 3.x
body: <p>I found quite some solutions to uploading video with the facebook SDK, but none of them work (including the information from the facebook developer blog). Here is the code I'm using to upload a video. The "out_composed.mov" is created successfully, as I can save that video in the gallery or send it via email.</p>
  
  <pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  NSString *documentsDirectoryPath = [paths objectAtIndex:0];
  NSString* composedOutputPath = [documentsDirectoryPath stringByAppendingPathComponent:@"out_composed.mov"];
  NSData *videoData = [NSData dataWithContentsOfFile:composedOutputPath];
  
  NSMutableDictionary&lt;FBGraphObject&gt;* params = [FBGraphObject graphObject];
  [params setDictionary:[NSMutableDictionary dictionaryWithObjectsAndKeys:
                         videoData, @"video.mov",
                         @"video/quicktime", @"contentType",
                         @"My awesome video", @"title", nil]];
  
  if (!appDelegate.session.isOpen)
  {
      [FBSession openActiveSessionWithPermissions:[NSArray arrayWithObjects:@"offline_access", @"publish_stream",@"user_videos",@"video_upload",nil] allowLoginUI:true completionHandler:^(FBSession *session, FBSessionState status, NSError *error)
                             {
                                 FBRequest* uploadVideoRequest = [FBRequest requestForPostWithGraphPath:@"/me/videos" graphObject:params];
                                 [uploadVideoRequest startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error)
                                  {
                                      // The server returns "353 missing video file" here.
                                      if(error != nil) NSLog(@"%@",[error description]);
                                      else NSLog(@"Error: %@", error);
                                  }];
                             }];
      appDelegate.session = [FBSession activeSession];
  } else
  {
      FBRequest* uploadVideoRequest = [FBRequest requestForPostWithGraphPath:@"/me/videos" graphObject:params];
      [uploadVideoRequest startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error)
       {
           if(error != nil) NSLog(@"%@",[error description]);
           else NSLog(@"Error: %@", error);
       }];
  }
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1fdc94a0 {com.facebook.sdk:ParsedJSONResponseKey={
      body =     {
          error =         {
              code = 353;
              message = "(#353) Missing video file";
              type = OAuthException;
          };
      };
      code = 400;
  }, com.facebook.sdk:HTTPStatusCode=400}
  </code></pre>
  
  <p>How can I fix this? Thanks a lot in advance!</p>
  
  <p>Heiko</p>