Trying to upload photos by access token, album_id or user_id and URL but getting an error:

"(#324) Requires upload file"
"OAuthException"

I've checked the token and it's valid. Also upload from file works, but upload from URL does not. Facebook does not seem to want to recognise the "url" parameter. This is strange because I swear the other day when I tested this it worked fine.

I've also checked, it works in FB's graph API explorer, but does not work when using any REST client tool either.

UPDATE:
I got it to work by switching the order of the array inside http_build_query so that the URL is first (or removing the 'message' parameter). The second element is always ingored.

Can anyone see what I'm doing wrong? Why is the second parameter ignored in this case? While the upload "works" I'd still like the 'message' parameter to work so that the image description can also be loaded.

I tried leaving that out but i get an error that says "Content-type not specified assuming application/x-www-form-urlencoded". What should it be instead? "text/plain"?
–
Dave SOct 8 '12 at 12:10

Any ideas what it should be? I tried a bunch and got the same result (Tried: text/plain, text/html, application/xml. First http_build_query parameter is read, the others ignored).
–
Dave SOct 8 '12 at 12:52

“First http_build_query parameter is read, the others ignored” – try setting the third parameter of the function http_build_query to '&' explicitly – otherwise it might use '&amp;', and that messes up the parameters.
–
CBroeOct 8 '12 at 14:38