Starting App’s For Facebook
Written by Chris on September 19, 2007 – 5:52 pm -Yesterday for a bit of fun I decided I'd try and write my first application for facebook - and I have to say the setup based on the example code they give you is pretty straightforward, however it could do with some extra vital documentation.
What would be in this documentation you ask?
You might think, "being a social networking site users may want to upload photos or other files to your app. for various reasons", so lets make that side of things easy and secure.
Well obviously facebook didn't, and as such seem to have turned off/prevented access to PHP's $_FILES array and don't mention it anywhere obvious.
This is annoying as it wasn't really mentioned anywhere and, after all, your app is essentially it's own self contained program sitting on it's own server somewhere which obeys it's own set of rules and just appears on facebook by means of, what can only be described as an extended iframe, so why should they prevent access?
In fact file upload is possible but you have to do it via some convoluted method where you mime encode the file and send it through via POST, which is a pain.
Though I spent 3 hours or so trying to work out why my app wasn't receiving files before finding this out, that hasn't deterred me and you can expect some more posts about Facebook app building here as soon as I have time to write them
Popularity: 7% [?]
Sphere: Related ContentRelated posts on coderchris.com:
- Meld Wordpress And Facebook Together With Wordbook
Now this is a pretty neat plugin: Wordbook allows you to send your wordpress... - 2 New Facebook Apps Begun
Today I have started writing 2 new Facebook applications, Doomsday Device and Game Stats.... - Word 2007 Is Great!
One of the best features of Word 2007 is that you can blog directly from... - Simple Function To Force Download Of A File
The following function will allow you to run a file download through PHP, you... - Funky ORM with PHPDoctrine
I work on all sorts of little personal projects in my spare time, most...
Tags: app, applications, facebook, PHP
Posted in MySQL, PHP | Trackback |















Feed 

October 10th, 2007 at 12:24 am
I had the exact same problem, after two hours of missioning around, I decided to give up, and google a bit, and found your post.
Damn, this annoys me!!!
October 10th, 2007 at 12:58 am
Tell me about it!
I can understand it to an extent, but that doesn’t make it any less of a pain
November 17th, 2007 at 4:14 pm
One month later, I’m on to the same thing, and find that its not really that easy to do file upload
In case somebody else has the same issue, please head over to http://wiki.eyermonkey.com/Facebook_Photo_Uploads and try the library there.
It doesn’t work on the first try, but you can get some ideas from it.
When I get it to work, I’ll put up my own library…