When I try a simple file upload and
params[:image][:file_name].original_filename in the controller I get an
error: "The error occurred while evaluating nil.original_filename". What
could be wrong? The form is multipart <% form_tag :action =>
"create_image", :multipart => true do %>
The file field is: <%= file_field 'image', 'file_name' %>
When I try a simple file upload and
params[:image][:file_name].original_filename in the controller I get an
error: "The error occurred while evaluating nil.original_filename". What
could be wrong? The form is multipart <% form_tag :action =>
"create_image", :multipart => true do %>
The file field is: <%= file_field 'image', 'file_name' %>
Is it that params[:image][:file_name] is just a string, not an object
with the method original_filename?
What does the rest of the controller code look like in the create? Have
you done the @model = Model.new(params[:image]) yet?
Is it that params[:image][:file_name] is just a string, not an object
with the method original_filename?
What does the rest of the controller code look like in the create? Have
you done the @model = Model.new(params[:image]) yet?
Could be. I don't know. It should be an object. I'll check.
I've done the Model.new. I've taken my code from another app where I got
it working, so it should work. Can it be an issue of permissions, that
it can't access the file? Where is the file stored in-between in a file
upload?