Topic: Attachment form a file?


i am reading in mails and creating rails objects from that.
My code is working for form upload and attachments (it needs the methods original_filename, etc.)

I also want to save the text-part of an email as a file in my system, so i want to handle it like an attachment.
But if i create a file from the body-part, methods like original_filename are not present for regular files from File.

Any ideas?

Re: Attachment form a file?

Can to extract just the body part into a rails instance variable?

You don't want an object in a table for storage,  but you want a physical file, right?

Is the question 'how to extract the "body part"  from an email?

Or is the question once you've extracted it,  how do you save it?

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Attachment form a file?

My intetion was to save the body part with the same methods i use to save attachments and fileupload from forms.
But the part object dont have the suitable methods like original_filename etc.
I solved the problem with a small wrapper-class, so i dont need to change the other code.
Propably not the best solution but it works.