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
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?