I had a working code for Rails 2 to handle file uploads that no longer works with Rails 3. The code is:
# Handling file uploads
def file=(file_data)
unless file_data.blank?
@file_data = file_data
self.filename = file_data.original_filename
self.size_before = file_data.size
end
end
Now Rails 3 doesn't like that, complains with:
undefined method `original_filename' for "MyFile.Ext":String
Any solutions that doesn't involve using a file attachment handler (Paperclip, etc)?