Quantcast
Channel: Spring Community Forums - Social
Viewing all articles
Browse latest Browse all 145

Spring Social Facebook post photo failed with 400 error

$
0
0
I used latest spring social showcase, with spring framework 3.2.1 + spring security 3.1.3 + Spring social 1.1.0. Showcase works fine as I can post the status with just text, and also works with post links.
I need to post a photo, and used following code in FacebookFeedController,

FileSystemResource photo = new FileSystemResource("c:/temp/g1.png")
{
public String getFilename() throws IllegalStateException {
return "g1.png";
};
};
facebook.mediaOperations().postPhoto( photo,"test");

SEVERE: Servlet.service() for servlet [default] in context with path [/] threw exception [Request processing failed; nested exception is org.springframework.social.UncategorizedApiExcepti on: (#1) An unknown error occurred] with root cause
org.springframework.web.client.HttpClientErrorExce ption: 400 Bad Request

Cannot figure out why it failed.

Can someone help me?

Thanks

Viewing all articles
Browse latest Browse all 145

Trending Articles