Hi All.. I''ve got a newbie question... I''m trying to figure out SIMPLE FILE UPLOAD.. All the stuff I found on net is not really what I want. I want people to come on my web, upload any file they want, this file will be stored in the file system and neccessary info I need will be stored in DB. I tried : http://wiki.rubyonrails.com/rails/pages/HowtoUploadFiles http://manuals.rubyonrails.com/read/chapter/56 thanks milos kelemen
Have you tried file_column yet? It is mostly for image uploads, but should be able to be adapted. More can be found here: http://www.kanthak.net/opensource/file_column/ keith On Sep 30, 2005, at 1:58 PM, milos kelemen wrote:> Hi All.. > > I''ve got a newbie question... > > I''m trying to figure out SIMPLE FILE UPLOAD.. > All the stuff I found on net is not really what I want. > > I want people to come on my web, upload any file they want, this > file will be stored in the file system and neccessary info I need > will be stored in DB. > > I tried : > http://wiki.rubyonrails.com/rails/pages/HowtoUploadFiles > http://manuals.rubyonrails.com/read/chapter/56 > > thanks > > milos kelemen > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Keith Bingman wrote:> Have you tried file_column yet? It is mostly for image uploads, but > should be able to be adapted. More can be found here: > http://www.kanthak.net/opensource/file_column/ > > keith > > On Sep 30, 2005, at 1:58 PM, milos kelemen wrote: > >> Hi All.. >> >> I''ve got a newbie question... >> >> I''m trying to figure out SIMPLE FILE UPLOAD.. >> All the stuff I found on net is not really what I want. >> >> I want people to come on my web, upload any file they want, this file >> will be stored in the file system and neccessary info I need will be >> stored in DB. >> >> I tried : >> http://wiki.rubyonrails.com/rails/pages/HowtoUploadFiles >> http://manuals.rubyonrails.com/read/chapter/56 >> >> thanks >> >> milos kelemen >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >>thanks, however...to be honest, I don''t know how to handle file save... def create ??? end I''m afraid file_column handle this as well... any clues?
Keith Bingman wrote:> Have you tried file_column yet? It is mostly for image uploads, but > should be able to be adapted. More can be found here: > http://www.kanthak.net/opensource/file_column/ > > keith > > On Sep 30, 2005, at 1:58 PM, milos kelemen wrote: > >> Hi All.. >> >> I''ve got a newbie question... >> >> I''m trying to figure out SIMPLE FILE UPLOAD.. >> All the stuff I found on net is not really what I want. >> >> I want people to come on my web, upload any file they want, this file >> will be stored in the file system and neccessary info I need will be >> stored in DB. >> >> I tried : >> http://wiki.rubyonrails.com/rails/pages/HowtoUploadFiles >> http://manuals.rubyonrails.com/read/chapter/56 >> >> thanks >> >> milos kelemen >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >>having problem: ------------- CONTROLLER class QuotefilesController < ApplicationController def new @quotefile = Quotefile.new(params[:quotefile]) end def create @quotefile = Quotefile.new(params[:quotefile]) if @quotefile.save render :action => "done" else render :action => "new" end end def done @quotefiles = Quotefile.find_all end end --------------- VIEW: new: <%= form_tag ({:action => "create"}, :multipart => true) %> <%= file_column_field "quotefile", "filename" %> <%= submit_tag%> <%= end_form_tag %> <%= debug(@quotefile) %> ------------------ done: done<br /> <% @quotefiles.each do |qf|%> <%= qf.filename %><br /> <% end %> ----------------------------- this create method saves in my filename attribute this: !ruby/object:File {} ...? any clues..? thanks
milos, just to be sure, do you have file_column declared there? you should have: class Quotefiles < AR file_column "filename" hope this helps Oliver 2005/9/30, milos kelemen <kelemen-3bu9hXS+wrdaa/9Udqfwiw@public.gmane.org>:> Keith Bingman wrote: > > Have you tried file_column yet? It is mostly for image uploads, but > > should be able to be adapted. More can be found here: > > http://www.kanthak.net/opensource/file_column/ > > > > keith > > > > On Sep 30, 2005, at 1:58 PM, milos kelemen wrote: > > > >> Hi All.. > >> > >> I''ve got a newbie question... > >> > >> I''m trying to figure out SIMPLE FILE UPLOAD.. > >> All the stuff I found on net is not really what I want. > >> > >> I want people to come on my web, upload any file they want, this file > >> will be stored in the file system and neccessary info I need will be > >> stored in DB. > >> > >> I tried : > >> http://wiki.rubyonrails.com/rails/pages/HowtoUploadFiles > >> http://manuals.rubyonrails.com/read/chapter/56 > >> > >> thanks > >> > >> milos kelemen > >> > >> _______________________________________________ > >> Rails mailing list > >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > >> > > having problem: > ------------- > CONTROLLER > class QuotefilesController < ApplicationController > > def new > @quotefile = Quotefile.new(params[:quotefile]) > end > > def create > @quotefile = Quotefile.new(params[:quotefile]) > if @quotefile.save > render :action => "done" > else > render :action => "new" > end > end > > def done > @quotefiles = Quotefile.find_all > end > end > --------------- > VIEW: > > new: > <%= form_tag ({:action => "create"}, :multipart => true) %> > <%= file_column_field "quotefile", "filename" %> > <%= submit_tag%> > <%= end_form_tag %> > > <%= debug(@quotefile) %> > ------------------ > done: > done<br /> > <% @quotefiles.each do |qf|%> > <%= qf.filename %><br /> > <% end %> > ----------------------------- > > this create method saves in my filename attribute this: > !ruby/object:File {} > ...? > > any clues..? > > thanks > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Oliver Barnes wrote:> milos, just to be sure, do you have file_column declared there? you should have: > class Quotefiles < AR > file_column "filename" > > hope this helps > Oliver > > 2005/9/30, milos kelemen <kelemen-3bu9hXS+wrdaa/9Udqfwiw@public.gmane.org>: > >>Keith Bingman wrote: >> >>>Have you tried file_column yet? It is mostly for image uploads, but >>>should be able to be adapted. More can be found here: >>>http://www.kanthak.net/opensource/file_column/ >>> >>>keith >>> >>>On Sep 30, 2005, at 1:58 PM, milos kelemen wrote: >>> >>> >>>>Hi All.. >>>> >>>>I''ve got a newbie question... >>>> >>>>I''m trying to figure out SIMPLE FILE UPLOAD.. >>>>All the stuff I found on net is not really what I want. >>>> >>>>I want people to come on my web, upload any file they want, this file >>>>will be stored in the file system and neccessary info I need will be >>>>stored in DB. >>>> >>>>I tried : >>>>http://wiki.rubyonrails.com/rails/pages/HowtoUploadFiles >>>>http://manuals.rubyonrails.com/read/chapter/56 >>>> >>>>thanks >>>> >>>>milos kelemen >>>> >>>>_______________________________________________ >>>>Rails mailing list >>>>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>http://lists.rubyonrails.org/mailman/listinfo/rails >>>> >> >>having problem: >>------------- >>CONTROLLER >>class QuotefilesController < ApplicationController >> >> def new >> @quotefile = Quotefile.new(params[:quotefile]) >> end >> >> def create >> @quotefile = Quotefile.new(params[:quotefile]) >> if @quotefile.save >> render :action => "done" >> else >> render :action => "new" >> end >> end >> >> def done >> @quotefiles = Quotefile.find_all >> end >>end >>--------------- >>VIEW: >> >>new: >><%= form_tag ({:action => "create"}, :multipart => true) %> >> <%= file_column_field "quotefile", "filename" %> >> <%= submit_tag%> >><%= end_form_tag %> >> >><%= debug(@quotefile) %> >>------------------ >>done: >>done<br /> >><% @quotefiles.each do |qf|%> >> <%= qf.filename %><br /> >><% end %> >>----------------------------- >> >>this create method saves in my filename attribute this: >> !ruby/object:File {} >> ...? >> >>any clues..? >> >>thanks >> >>_______________________________________________ >>Rails mailing list >>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>http://lists.rubyonrails.org/mailman/listinfo/rails >>Hi Oliver, this was my problem :), the file_column was defined however under different name than supposed to be... :) thanks again.. file_column is really helpful... m_klmn