Hi everyone,
I’m having trouble uploading some files. I’ve set up a simple action
whose
view looks like:
<%= start_form_tag({:action => ‘handle_file_test’}, {:multipart =>
true}) %>
File to Upload <%= file_field_tag “file” %>
<%= submit_tag %>
<%= end_form_tag %>
<% if defined? @file.original_filename %>
<%= debug @file %>
<%= @file.original_filename %>
<%= @file.path %>
<%= @file.content_type %>
<% end %>
The controller simply assigns params[:file] to @file.
For some of my files, “debug @file” reports that @file is a string. For
these files, @file.path is empty. I can’t figure out any pattern for
why
this is happening. I upload one jpeg file, and the file shows up as a
file.
I upload another, and the file shows up as a string.
Any ideas?
Thanks!