File Column open tmp file

Does anyone know how to open a file like the below?

“Filedata”=>#<File:/var/folders/9D/9D8PtWGBFgmSvF-Ue+uD9++++TI/-Tmp-/RackMultipart20110121-7108-6aqdij-0>}

file_column is used to upload a document and i need to open it just with
the information above,

Any ideas?

JB

Should be able to use .tempfile()

Garrett L.

Garrett L. wrote in post #976554:

Should be able to use .tempfile()

Garrett L.

thanks, have that working now.

What i really need is to be able to add that file to a model in the
controller, the field is a file column field.

I know it generally comes from a form and is saved but in this instance
i have the tmp file
“Filedata”=>#<File:/var/folders/9D/9D8PtWGBFgmSvF-Ue+uD9++++TI/-Tmp-/RackMultipart20110121-7108-6aqdij-0>}

and i need to do some processing first and then add it to the model, any
suggestions?

JB

Can you use one of the attachment libraries (like Paperclip)? If not,
you might still be able to find some inspiration there.

and i need to do some processing first and then add it to the model, any
suggestions?

If you’re doing image processing check out ImageMagick (also works
with Paperclip) or ImageScience. If you’re doing general file
management stuff then Ruby’s modules File, FileUtil, and Tempfile may
be relevant.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs