On Tue, Feb 17, 2009 at 11:18 AM, Tonu Mikk <tm...@umn.edu> wrote:

>
> Hi Django community,
>
> I have a question regarding uploading files.  In this page in Django
> documentation
>
> http://docs.djangoproject.com/en/dev/topics/http/file-uploads/#topics-http-file-uploads
> ,
> there is an example of handling an uploaded file like so:
>
> def handle_uploaded_file(f):
>    destination = open('some/file/name.txt', 'wb+')
>    for chunk in f.chunks():
>        destination.write(chunk)
>    destination.close()
>
> This code saves the uploaded file with the name 'name.txt'.  I would like
> to save the uploaded file with the original file name.  How could that be
> accomplished?
>
> Thank you!
> Tonu
>
>
> >
>
Uploaded files have a name attribute that contains their name.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

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