public
def save_HTML @filename = @params[:eSimplyJob][:file].original_filename
File.open("#{RAILS_ROOT}/htmlfiles/#{@filename}", “wb”) do |f|
f.write(@params[:eSimplyJob][:file].read)
end
puts “Finished with save_HTML”
end
When I execute the upload, I get the following error:
undefined method `original_filename’ for “upload.rhtml”:String
I understand that this means that @params[:eSimplyJob][:file] is a
String and not an IO object.
public
def save_HTML @filename = @params[:eSimplyJob][:file].original_filename
File.open("#{RAILS_ROOT}/htmlfiles/#{@filename}", “wb”) do |f|
f.write(@params[:eSimplyJob][:file].read)
end
puts “Finished with save_HTML”
end
When I execute the upload, I get the following error:
undefined method `original_filename’ for “upload.rhtml”:String
I understand that this means that @params[:eSimplyJob][:file] is a
String and not an IO object.
Hey Wes,
Can you help me if I ask you to make the uploading restricted to only
doc files?
Since you are half way already, I think you’ll be able to guess what I
am talking about.
Thanks in advance.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.