views:

1389

answers:

4

Hi All

Is it possible to upload file in facebook fbml (not iframe) using Ajax ? not a complicated one but just use simple input type="file" tag wrap in a form and post the from using facebook builtin ajax. If can, then how to accept it in server ? I'm using rails facebooker as my backend and paperclip plugin as my file upload system.

Thanx

A: 

client can=server can.

LarsOn
+1  A: 

When I was looking for AJAX uploads, the best I could find was only using iFrames. From this, I assume it's not possible?

James Brooks
yes, from googling it seems no example or article explain in detail about this, but I need to upload a file in facebook pages and considering that facebook pages only allow fbml, are there a way to achieve this ?
gkrdvl
I have no experience in FBML, but doesn't Facebook allow you to use an iFrame on your application to display a web page anyway? Just use the iFrame method in that!
James Brooks
If that's no help, try this; http://stackoverflow.com/questions/1238421/facebook-cannot-upload-file-using-the-input-typefile-tag
James Brooks
A: 

There is no easy way to do so in a fbml app. However what you can do is that you should create a normal file uploading script (non fbml) and submit your request to that script. This script uploads the file and goes back to the original fbml page.

I have done that in following app:

apps.facebook.com/theaffinity

Sarfraz
A: 

Shouldn't it be possible to do something like in Gmail (i.e. AJAX file uploader with loading bar and not having to refresh the page) on a FBML page? Probably with a hidden fb:iframe that would post directly to your own server (not facebook's)..

I'm afraid it would probably take me days, but if anyone has figured it out, please post back :)

mb21