The old code expects params[:attachments][“upload#{i}”] to be an object
(File?)
with a method “original_filename”.
I am using ajax (and previously didn’t):
The old code expects params[:attachments][“upload#{i}”] to be an
)
Do I need to change anything because of ajax?
File uploads can’t be done over ajax (because the javascript isn’t
allowed to read files from your computer). There are tricks you can
play with iframes and so on.
I am using ajax (and previously didn’t):
parameters:Form.serialize(this) + ‘&authenticity_token=’ +
encodeURIComponent(‘a5de291b429a9def0d4ff822d8e278172e472a28’)});
return false;">
)
Do I need to change anything because of ajax?
Indeed as another poster has already mentioned you can’t upload files
through ajax (javascript security).
Either use a Flash uploader like swfupload.org (but if you’re not
fairly fluent in Javascript, i would advise against it), do know that
the new session security measures cause problems if you want the
upload to be authenticated or search for the responds_to_parent
plugin and follow the instructions.