Closed GoogleCodeExporter closed 9 years ago
I forgot: I have this issue both on Windows and on Mac.
Original comment by riccardo...@gmail.com
on 5 Apr 2012 at 7:47
Hm, let me check into it. According to Google this has been a problem for
others and sounds like it might be a bug on FB's end (people are reporting it's
intermittent), or there may be an issue with the access token used to do the
post. See
https://developers.facebook.com/bugs/186962478087789/?browse=search_4f7a913dd260
13433354453 and Google for "OAuthException: (#324) Missing or invalid image
file." for more details
Original comment by m...@xmog.com
on 5 Apr 2012 at 1:46
Thanks for the answer I already googled, but without finding a common problem
about this situation.
Anyway I don't think it's a facebook problem because if you try to issue an
HTTP POST multipart to me/photos using facebook Graph API documentation it
works fine (BTW it works using the same access token that fails on RestFB call).
If you test a photo publish using RestFB does it works correctly?
Original comment by riccardo...@gmail.com
on 5 Apr 2012 at 3:01
I have just verified that this works correctly using an access token generated
by the Graph API explorer (see attached image for my permissions and attached
cat.png pic). Here is my code:
String accessToken = "XXX";
FacebookType publishPhotoResponse =
new DefaultFacebookClient(accessToken).publish("me/photos", FacebookType.class,
BinaryAttachment.with("cat.png", Tester.class.getResourceAsStream("/cat.png")),
Parameter.with("message", "Test cat"));
System.out.println("Published photo ID: " + publishPhotoResponse.getId());
Original comment by m...@xmog.com
on 5 Apr 2012 at 3:09
Attachments:
I am also seeing the same problem.
I went to facebook, and generated a new graph access-token with permissions
matching the ones mentioned above.
Then I ran the GrapthPublisherExample that comes with restFB.
The first run, the photo was uploaded successfully, but all subsequent runs
fail. Facebook returns 200 OK.
I will appreciate any help with this issue.
Thanks.
This is what I do:
C:\restfb-1.6.9\source\example>ant run-publisher-examples
"-Daccess_token=my_token"
Buildfile: C:\cz\restfb-1.6.9\source\example\build.xml
compile:
[echo] Compiling examples...
[javac] C:\restfb-1.6.9\source\example\build.xml:28: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
run-publisher-examples:
[java] * Binary file publishing *
[java] Apr 18, 2012 4:31:38 PM com.restfb.DefaultWebRequestor executePost
[java] INFO: Executing a POST to https://graph.facebook.com/me/photos with parameters message=Test cat&access_token=my_token&format=json and 1 binary attachment[s].
[java] Apr 18, 2012 4:31:54 PM com.restfb.DefaultFacebookClient makeRequestAndProcessResponse
[java] INFO: Facebook responded with HTTP status code 200 and response body: {"id":"407004595982232","post_id":"100000408846376_406963045992227"}
[java] Published photo ID: 407004595982232
BUILD SUCCESSFUL
Total time: 17 seconds
Original comment by sandeepa...@gmail.com
on 18 Apr 2012 at 11:05
Can you show an example of where the call fails? The snippet you provided
shows it working correctly.
Original comment by m...@xmog.com
on 19 Apr 2012 at 2:26
Thanks for your reply. We got it working today by adding publish_photo
permission to the access token.
Original comment by sandeepa...@gmail.com
on 19 Apr 2012 at 5:26
Sounds like everything is good with correct permissions - closing this out.
Original comment by m...@xmog.com
on 12 Jul 2012 at 2:21
Original issue reported on code.google.com by
riccardo...@gmail.com
on 5 Apr 2012 at 7:46