No commit activity in last 3 years
No release in over 3 years
Multiupload-uploadify is a gem for multiupload using the uploadify plugin
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

Runtime

~> 3.2.6
 Project Readme

multiupload-uploadify

Multiupload-uploadify is a gem for multiupload using the uploadify plugin

###Getting started

To use add this to your Gemfile

gem "multiupload-uploadify"

Run the bundle command to install it.

Now you need run the generate command

rails generate multiupload_uploadify

Add this in your application.js

//= require jquery.uploadify-3.1
//= provide dependencies

and this to your application.css

*= require uploadify

To use the muptiupload gem you can use the helper method in your view

<%= multiupload_field :url => new_photo_path %>

and add this in your layout file

<%= content_for :scripts if content_for? :scripts %>

and in your controller you can get the files through the Filedata param

Photo.create(:picture => params[:Filedata])

if you want to know the id of the model you need do this

in your controller

photo = Photo.create(:picture => params[:Filedata])
render :text => photo.id

and pass a javascript function responsible for handling the return of the request

<%= multiupload_field :url => new_photo_path, :options => { :onUploadSuccess =>  'myFunction' %>
<script type="text/javascript">
function myFunction(file, data, response){
	alert(data);
}
</script>

any other parameter of the plugin you can pass using

<%= multiupload_field :url => new_photo_path, :options => { :buttonText =>  '"Upload Photos"' %>

devise + multiupload-uploadify

if you use the devise gem you need pass the parameters of your session for authentication you can do it like this:

<%= multiupload_field :url => new_photo_path, :parameters => {Rails.application.config.session_options[:key] => "'#{cookies[Rails.application.config.session_options[:key]]}'" } %>