views:

794

answers:

1

Hi, i have an application working fine with form_for updloading an image using paperclip.

The problem is, because of the javascript security model, it cannot upload a picture via AJAX.

I would like to know: what is the best approach, that really works with rails 2.3.x, to send file via aJAX using rails? IFRAME technique? swfupload? Any other idea?

VP

+3  A: 

The iframe technique is the way to go for AJAX file uploading. I currently just implemented something like this and I followed the tutorial from this page: http://khamsouk.souvanlasy.com/articles/ajax_file_uploads_in_rails_using_attachment_fu_and_responds_to_parent

In the tutorial he uses attachment_fu but the code works just fine with paperclip.

Hope this helps,

Caleb

CalebHC
i did it but i didnt like the results. i think i will try a modal fluffy windows to do the find and upload.
VP