Pål Bergström | 20 Jul 22:09

Re: File upload and doc type


>> 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
-~----------~----~----~----~------~----~------~--~---


Gmane