Guest User

Untitled

a guest
Apr 26th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #Basefiles model action
  2. def swfupload
  3. @basefile = Basefile.from(params[:Filedata])
  4. @basefile.folder_id = params[:folder_id]
  5. p "CRUUUUURD"
  6. p params[:folder_id]
  7. @basenumber = @basefile.folder_id
  8. @basefile.save!
  9. redirect( "folders/"+"#{@basenumber}" )
  10.  
  11. end
  12.  
  13.  
  14. #script
  15. var uplooad2 = new FancyUpload($('photoupload2-filedata-1'), {
  16. swf: '/javascripts/swiff/Swiff.Uploader.swf',
  17. queueList: 'photoupload-queue-2'
  18. });
  19.  
  20.  
  21. #View
  22. <% form_tag(:action => "/swfupload", :id => "photoupload2",
  23. :enctype => "multipart/form-data") do %>
  24. <%= file_field :name => 'Filedata', :label => "Your file:", :id => "photoupload2-filedata-1" %> <br />
  25.  
  26. <%#= hidden_control @folder, :value => @folder.id %><br />
  27. <%= hidden_field :name => "folder_id", :value => @folder.id %>
  28. <%= submit_button "Upload!" %>
  29. <% end %>
Add Comment
Please, Sign In to add comment