By the way, I just found a file_data method called original_path.
This is what is used to generate original_filename.  But bummer,
in my case, original_path is already just the basename. 

Also, there is a method called "path".  But it turns out the object
the controller is working with is an UploadedTempFile, and the path()
method gives you a path to /tmp/blah on the server.

Is there a "best practice" on this situation that I may be unaware of?

        -glenn

Glenn Little wrote:
> Does anyone know of a clean way to pass file upload field data
> to a rails controller and back to an edit form?
> 
> The problem is this:  user fills out a (possibly lengthy) form,
> then submits.  If the form does not validate, we give them
> back the form with most values filled in.  But I don't know
> how to re-seed the file upload fields.  Among the problems
> are that they seem to treated/interpreted differently on the
> client side, depending on browser and OS.  Rails never (reliably
> anyway) gets to see the actual file path that is the usual
> content of a file upload field.  I think the problem is that
> it's not really well defined what the "content" of a file upload
> field is.  Is it the data stream?  Is it the file path? 
> How is this situation usually (simply) dealt with?
> 
> Thanks!
> 
>     -glenn

--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to