Hi all,
Somewhat of a noob here. I have a table that has 5 file fields, and
they are named file, file2, file3, file4, file 5. All of them will be
.doc files.
In firefox, I can upload these files just fine, and they will show up
as Document.doc. In IE, it prepends the entire path.
C:\My Documents\User\Desktop\Document.doc
Which makes the file unreadable, and un-downloadable. I know that the
sanitize method is supposed to fix this, but I can''t figure out how to
make it work. Here is what I''ve written in my model:
def self.sanitize_filename(filename)
filename = File.basename(filename.gsub("\\", "/"))
filename.gsub(/[^a-zA-Z0-9\.\-\+_]/,"_")
end
Doesn''t work. What do I need to do? This is bugging me so much.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---