I have setup the application for paperclip and uploadify. Paperclip works fine. But for multiple file upload, uploadify doesn't work i.e. it doesn't change <input type="file"
and moreover when in the file select form, it doesn't allow to select more than one file.
I have followed given-below steps
downloaded uploadify and extracted under assets/ i.e. assets/uploadify
a.uploadify.swf
andcancel.png
in assets/images
b.jquery.uploadify.v2.1.4.js
,jquery.uploadify.v2.1.4.min.js
, andswfobject.js
assets/javascripts
c.uploadify.css
intoassets/stylesheets
d. createdmiddleware
directory.added the following scripts to upload
$(document).ready(function() { <% key = Rails.application.config.session_options[:key] %> var uploadify_script_data = {}; var csrf_param = $('meta[name=csrf-param]').attr('content'); var csrf_token = $('meta[name=csrf-token]').attr('content'); uploadify_script_data[csrf_param] = encodeURI(encodeURIComponent(csrf_token)); uploadify_script_data['<%= key %>'] = '<%= cookies[key] %>'; $('.uploadify').uploadify({ uploader : '/assets/uploadify.swf', script : '/assets/uploadify', cancelImg : '/images/cancel.png', auto : true, multi : true, removeCompleted : true, scriptData : uploadify_script_data, onComplete : function(event, ID, fileObj, doc, data) { } }); }); </script>
List item
also, modified
session_store.rb, application.js
,finally, added class to input
type=file "
, class = 'uploadify'"
Please suggest where have I gone wrong.
Thanks John