In my app, my user inputs one more more attachments and on the server
side I am successfully getting them via code like this:

                for file in request.FILES.getlist('attachment'):
                    a = Attachment(
                        filename = filename,
                        mime_type=mimetypes.guess_type(filename)[0] or
'application/octet-stream',
                        size=file.size,
                        )

In certain cases the user has errors in other parts of the form, and I
need to re-render the form.  In this case I would like to re-fill the
inputs that they originally filled with the paths to their
attachments.  IE, prior to submitting the form, they browsed to some
file and selected it as their attachment.  When I re-render the form
after detecting an error, I would like them to not have to re-browse
to find their attachment again.

However, I do not see any way of getting the orignal path name from
the InMemoryUploadedFile that I have access to in my <file> variable.

Does anyone know if there is a way to get this original path?

Thanks!

Margie
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to