Home > MySQL, PHP > Starting App’s For Facebook

Starting App’s For Facebook

September 19th, 2007 Chris Leave a comment Go to comments

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 :)

Related posts on coderchris.com:

  1. MySQL 5.1 partitioning and loosing all your databases (or not)!
    I can across a few other funky things in MySQL 5.1 today that I thought...
  2. Meld Wordpress And Facebook Together With Wordbook
    Now this is a pretty neat plugin: Wordbook allows you to send your wordpress blog...
  3. Simple Function To Force Download Of A File
    The following function will allow you to run a file download through PHP, you could...
  4. 2 New Facebook Apps Begun
    Today I have started writing 2 new Facebook applications, Doomsday Device and Game Stats. You...
  5. Installing Flash Media Server 2 On Linux (CentOS 4.4)
    Recently I was asked by a client to look at purchasing and installing FMS2 on...

Categories: MySQL, PHP Tags: , , ,
  1. October 10th, 2007 at 00:24 | #1

    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!!!

  2. October 10th, 2007 at 00:58 | #2

    Tell me about it!

    I can understand it to an extent, but that doesn’t make it any less of a pain :(

  3. November 17th, 2007 at 16:14 | #3

    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…

  1. No trackbacks yet.