file upload

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

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.

is there any link to guide file upload

Jai Jai wrote:

is there any link to guide file upload

Let 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

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

thank you very much friend...it works charm...

use atachement_fu or file_column plugin it handles everything
magically.
Check there documentation , google is god remember.!!

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: