From: bill walton Date: 2006-12-16T06:15:06+09:00 Subject: Re: REXML usage I should have noted, in case the point wasn't clear from the code sample, the string vs. file issue has nothing to do with REXML. bill walton wrote: > Kevin Tambascio wrote: > > When I import the large file, the file_obj is a File object. > > When I import the small file, file_obj is a String object. > > Here's a snippet I'm using to allow a visitor to upload a file they've > specified via a file_field_tag. > > if params[:file_to_upload].instance_of?(Tempfile) > FileUtils.copy(params[:file_to_upload].local_path, > #{RAILS_ROOT}/public/#{@filenametouse}") > else > File.open("#{RAILS_ROOT}/public/#{@filenametouse}","w"){|f| > > f.write(params[:file_to_upload].read) > > f.close} > end > > > hth, > Bill