Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #View
- <form action="/swfupload" method="post" id="photoupload2" enctype="multipart/form-data">
- <div class="halfsize">
- <fieldset>
- <legend>Uploader</legend>
- <div class="label emph">
- <label for="photoupload2-filedata-1">
- Upload Files:
- <span>After selecting the photos start the upload.</span>
- </label>
- <input type="file" name="Filedata" id="photoupload2-filedata-1" />
- </div>
- </fieldset>
- </div>
- #Controller
- def swfupload
- # swfupload action set in routes.rb
- # The content_type is set as application/octet by the flash program
- # Use mimetype-fu to determine the mimetype before passing it
- # to the attachment_fu enabled model
- @basefile = Basefile.from(params[:Filedata])
- #Basefile.from(params[:butt])
- # params[:Filedata].content_type = File.mime_type?(params[:Filedata].original_filename)
- # @basefile = Basefile.from(params[:butt] => params[:Filedata])
- @basefile.folder_id = params[:folder_id]
- @basenumber = @basefile
- @basefile.save!
- redirect( "folders/"+"#{@basenumber}" )
- # redirect_to :controller => 'folders', :id => params[:id]
- # This returns the thumbnail url for handlers.js to use to display the thumbnail
- # rescue
- # render :text => "Error"
- end
Add Comment
Please, Sign In to add comment