Max Williams
2008-Jan-30 17:43 UTC
Making an object the same as is returned by file_field_tag
I''m using attachment_fu, and can make an attachment object (a Logo, which is basically an image file) fine using the tempfile that is returned from the file_field_tag on a form. However, i also need to make some from some files that are saved locally, in my public folder. I''m making a Tempfile object using the local file, but when i pass it to attachment_fu, it fails and crashes out. Looking at the file i''ve made and the file that is sent back, one obvious difference is in the size attribute - for the working one from file_field_tag it''s sensible, for the one i make, size = 0. At the moment i''m copying the file into /tmp and then just calling Tempfile.open with it. But as i said this results in a file with size 0. Am i just making the Tempfile wrong? Can anyone tell me how to make a Tempfile that can be passed to attachment_fu? thanks max -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---