Problem with full_original_filename.
I am upgrading from rails 1.1.6 to 2.3.2.
<%= file_column_field 'gallery', 'filename', :size => 100 %>
upload_dir = params[:gallery][:filename].full_original_filename
Works fine in production which is rails 1.1.6.
In development (rails 2.3.2) I get:
NoMethodError (undefined method `full_original_filename' for #<File:/
Any help would be appreciated. This is the last problem I am having
with the upgrade.
Any kind of idea/help would be appreciated. I am stuck.
Try using .path rather than .full_original_filename; looks like the
API was changed at some point.
In rails 1.1.6, when I print to the log “params[:gallery]
[:filename].full_original_filename”, I get:
C:\Documents and Settings\sultan\My Documents\Gallery\test
In rails 2.3.2, when I print to “params[:gallery][:filename].path”, I
I really need the windows full path name, so that I can upload all the
images in that directory (after I strip off the first file name).
I'm not sure what you mean by this - you can't upload files that the
user hasn't sent to you. In fact, the "full path" you're getting in
1.1.6 is a bug, caused by IE not sending the correct uploaded
filename. You'll probably need to look into the other multiple-file
upload plugins that are available.
The user clicks on any one file in the directory from which all the
images are to be uploaded. Once I extract the directory name, I go
back to the directory and perform a loop and upload each image file
into the photo gallery.
I know this only works in IE. This is a intranet application and the
clients only use IE.
Is there no way now to get the windows full path name?
What plugins would you recommend?
I don't think there's any way to get what you're looking for now; the
multipart-form-data parser now works around the incorrect data being
(reliably) resolve a C: reference?
Some links to check out for multiple-file upload (the most popular
method is SWFUpload):
The SWFUpload Flash part is open-source, so it should be relatively
straightforward to modify it to behave like you want (pick one file,
queue all the files in that directory).
Actually it's not the C: drive, it's a common drive accessible by
Thank you for your suggestion. As a first step I am going to create a
text field and copy paste the file path from the file filed into this
field. The second step would be to copy the information from the file