title: Facebook photo upload using HTTP request in Java
body: <p>I'm trying to upload a photo to my profile via HttpURLConnection.
  I have the acces token for user_status,user_photos,offline_access,publish_stream </p>
  
  <p>Samples from my code:</p>
  
  <pre><code>url = new URL("https://graph.facebook.com/me/photos");
  
  String content =
      "access_token=" + URLEncoder.encode ("my_token") +
      "&amp;message=" + URLEncoder.encode ("SUNT  !!!")+
      "&amp;url=" + URLEncoder.encode("file:///D:\\personale\\Images\\P0030_07-02-11_00.JPG");
  </code></pre>
  
  <p>When I make the request I got the following error</p>
  
  <pre><code>{"error":{"message":"file:\/\/\/D:\\personale\\Images\\P0030_07-02-11_00.JPG is an internal url, but this is an external request.","type":"CurlUrlInvalidException"}}
  </code></pre>
  
  <p>Can I upload files from my PC using the file URL ?
  How can I upload files, using byte array from files ?</p>
  
  <p>Many thanks !</p>