title: Always get video format not supported when posting a video
body: <p>I am trying to use the graph API to upload a video to a users wall. The result is always an error response of "{"error":{"message":"(#352) Video file format is not supported","type":"OAuthException"}}". I have tried several different video types that are all supported based on this list, <a href="http://developers.facebook.com/docs/reference/api/video/" rel="nofollow">http://developers.facebook.com/docs/reference/api/video/</a>. Based on my understanding of the documentation i have found, all that needs to be done is send a multipart form data request to "https://graph-video.facebook.com/me/videos" via a POST. BTW, I have been able to post a photo using similar techniques. The code i am using is below. It is based off of the PHP example at, <a href="http://developers.facebook.com/blog/post/493/" rel="nofollow">http://developers.facebook.com/blog/post/493/</a>. I have been able to upload the different videos using the facebook upload mechanism, so i know the videos are ok for Facebook. The access token is valid because i have used it to post a photo via the Graph API.</p>
  
  <p>Any suggestions to what i am missing are welcome!</p>
  
  <p>Here is the Java Code that i am using:</p>
  
  <pre><code>File video = new File(pathtovideofile);
  DataInputStream dis = new DataInputStream(new FileInputStream(video));
  byte[] bytes = new byte[(int)video.length()];           
  dis.read(bytes, 0, (int)video.length());
  
  // set up the http client, the http method, and the multipart entity
  DefaultHttpClient httpclient = new DefaultHttpClient();
  HttpPost httppost = new HttpPost("https://graph-video.facebook.com/me/videos");
  MultipartEntity mpEntity  = new MultipartEntity( );
  
  ContentBody cbVideo     = new ByteArrayBody(bytes, "video/mp4", "Video Label");
  ContentBody cbMessage     = new StringBody( "New Video" );
  ContentBody cbTitle     = new StringBody( "Video Title" );
  ContentBody cbAccessToken = new StringBody( accessTokenStr1 );
  
  mpEntity.addPart( "access_token", cbAccessToken );
  mpEntity.addPart( "file",         cbVideo        );
  mpEntity.addPart( "description",  cbMessage     );
  mpEntity.addPart( "title",        cbTitle     );
  
  // put the multipart entity into the request
  httppost.setEntity(mpEntity);
  // send the request
  HttpResponse response = httpclient.execute(httppost);
  
  // get the response entity
  HttpEntity resEntity = response.getEntity();
  // read the stream and print out the results
  InputStream instream = resEntity.getContent();
  BufferedReader reader = new BufferedReader(new InputStreamReader(instream));
  String line;
  StringBuilder responsestr = new StringBuilder();
  while (( line = reader.readLine()) != null) {               
    responsestr.append(line);
  }
  System.out.println(responsestr.toString());
  </code></pre>