Forum: Ruby on Rails Problem in file uploading

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
1f9d9a9efc2f523b2f09629444632b5c?d=identicon&s=25 ramesh (Guest)
on 2007-04-21 12:17

    According to the http://wiki.rubyonrails, I am trying to do the file
uploading .

   here i am sending my code

      @params['sendfile_label']['filename'] =
@file_data.original_filename.gsub(/[^\w._-]/, '') # This makes sure
filenames are sane
      @params['sendfile_label']['file_content'] =
      @params['label_upload'].delete('send_file') # let's remove the
field from the hash, because there's no such field in the DB anyway.

  If i try to excute this code its giving the following error..

   "undefined method `original_filename' for "mydoc.doc":String"

 Can any body facing this kind of problem..

This topic is locked and can not be replied to.