is there any link for step by step guide in file upload in database ... im follwing the link http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm.. which shows file upload into folder not in database ..pls help.. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jai Jai wrote:> is there any link for step by step guide in file upload in database ... > im follwing the link > http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm.. > which shows file upload into folder not in database ..pls help..Hi its never advisible to put the image into the db only the path of that image will be stored in the db..if you store the whole image into the db then the db size will be very large..and its not the best thing to do..So store only the path and not the image.. Thanks Dhaval Parikh Software Engineer Ruby on Rails http://www.railshouse.com -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
friend ...i need to upload file path or file name into database .. my upload.rhtml is <h2>New File</h2> <% form_for :upload, @upload, :url => { :action => ''new'' }, :html => { :multipart => true } do |f| %> <p> <label for="attachment_upload">Bestand:</label><br> <%= f.file_field :upload %> </p> <%= submit_tag ''Upload'' %> <% end %> in my controller i ve used def new if request.post? @upload = Upload.new(params[:upload]).save end end but its not working any help pls...& i also need to upload it in folder too. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
is there any link to guide file upload -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jai Jai wrote:> is there any link to guide file uploadLet me Explain You How To Upload File into Database : In This Case we have table called "boxes" for saving your file and Model name Boxe Column Names ==>> file_name | file_data | file_content Type Data ==>> string | blod | string ------------- CONTROLLER ------------- def save_file if params[:upload] != nil if params[:upload][''file''].size > 1 @warez = Box.new(params[:upload]) @warez.file_name = params[:upload][''file''].original_filename @warez.file_data = params[:upload][''file''].read @warez.file_content = params[:upload][''file''].content_type.chomp @warez.save end end end def download_file @download_warez = Box.find(params[:id]) send_data(@download_warez.file_data, :filename => @download_warez.file_name, :type => @download_warez.file_type) end ---------------- VIEW ---------------- <% form_tag ({:action => "save_file"}, {:multipart => true}) do %> <%= file_field "upload", "file" %><br><%= submit_tag "Upload" %> <% end %> <%= end_form_tag %> g00d Lvck Reinhart http://teapoci.blogspot.com -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Correction at :> def download_file...> :type => @download_warez.file_type)The correct is : :type => @download_warez.file_content) and the model name not Boxe but Box. Reinhart -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thank you very much friend...it works charm... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
use atachement_fu or file_column plugin it handles everything magically. Check there documentation , google is god remember.!! ----------- CJ(JON) ----- On Jul 4, 11:49 am, Jai Jai <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> thank you very much friend...it works charm... > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hi Dhaval, i have the same problem what you had.the problem is is there any link for step by step guide in file upload in database ... im follwing the link http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm.. which shows file upload into folder not in database ..pls help.. did u get the solution. if u get it please let me know wht is the solution. its very urgent for me. Dhaval Parikh wrote:> Jai Jai wrote: >> is there any link for step by step guide in file upload in database ... >> im follwing the link >> http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm.. >> which shows file upload into folder not in database ..pls help.. > > Hi > > its never advisible to put the image into the db only the path of that > image will be stored in the db..if you store the whole image into the db > then the db size will be very large..and its not the best thing to > do..So store only the path and not the image.. > > Thanks > > Dhaval Parikh > Software Engineer > Ruby on Rails > http://www.railshouse.com-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jai zenag wrote:> is there any link for step by step guide in file upload in database ... > im follwing the link > http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm.. > which shows file upload into folder not in database ..pls help..hi jai, iam also facing the same problem wht you had faced. did u get the solution for that problem,if u get it please let me know what is the solution. please its very urgent. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---