Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Basefiles model action
- def swfupload
- @basefile = Basefile.from(params[:Filedata])
- @basefile.folder_id = params[:folder_id]
- p "CRUUUUURD"
- p params[:folder_id]
- @basenumber = @basefile.folder_id
- @basefile.save!
- redirect( "folders/"+"#{@basenumber}" )
- end
- #script
- var uplooad2 = new FancyUpload($('photoupload2-filedata-1'), {
- swf: '/javascripts/swiff/Swiff.Uploader.swf',
- queueList: 'photoupload-queue-2'
- });
- #View
- <% form_tag(:action => "/swfupload", :id => "photoupload2",
- :enctype => "multipart/form-data") do %>
- <%= file_field :name => 'Filedata', :label => "Your file:", :id => "photoupload2-filedata-1" %> <br />
- <%#= hidden_control @folder, :value => @folder.id %><br />
- <%= hidden_field :name => "folder_id", :value => @folder.id %>
- <%= submit_button "Upload!" %>
- <% end %>
Add Comment
Please, Sign In to add comment