Upload a local file via Facebook API in Android

Allan Jiang picture Allan Jiang · Aug 9, 2011 · Viewed 8.7k times · Source

I'm trying to get a URL of a local image file in Android Gallery. I've tried formats like

file:///mnt/sdcard/test.jpg

or like

content://media/external/images/media/1

but none of them works. I'm just wondering if anyone can give me a properly formatted Android local file URL example? I need this to upload photo while checking in using Facebook api. thank you very much

Answer

dragonroot picture dragonroot · Aug 9, 2011

Facebook API can't use your local file URI as it doesn't have access to the contents of your phone. You need to use a POST request to physically upload the contents of your file.