20 Jul 22:09
Re: File upload and doc type
From: Pål Bergström <rails-mailing-list@...>
Subject: Re: File upload and doc type
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-20 20:09:46 GMT
Subject: Re: File upload and doc type
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-20 20:09:46 GMT
>> if params[:file_to_upload].instance_of?(Tempfile)
>> FileUtils.copy(params[:file_to_upload].local_path,
>> "#{RAILS_ROOT}/private/#{@filenametouse}")
>> else
>> File.open("#{RAILS_ROOT}/private/#{@filenametouse}","wb"){|f|
>> f.write(params[:file_to_upload].read)
>> f.close}
Can't get .local_path to work. Is that a rails method or something from
Ruby?
--
--
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@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
RSS Feed