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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---