On Tue, Feb 17, 2009 at 11:50 AM, Tonu Mikk <tm...@umn.edu> wrote: > Alex Gaynor wrote: > > Uploaded files have a name attribute that contains their name. > Yes, but how does one take advantage of that in this code? >
You simply use the name attribute of the UploadedFile instance you are working with. For example, if you wanted to rewrite the example you cited earlier to use the original name of the uploaded file, it would be: def handle_uploaded_file(f): destination = open(f.name, 'wb+') for chunk in f.chunks(): destination.write(chunk) destination.close() (If this wasn't obvious from the doc, you may need to do a bit more learning of Python before you are comfortable working with Django.) Karen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---