Help regarding renaming the uploaded file name in Django.

1,675 views
Skip to first unread message

sadeesh Arumugam

unread,
Nov 6, 2008, 7:45:27 AM11/6/08
to django...@googlegroups.com
Hi Friends,

I need a help from you. How to rename the uploaded file name in django. Example if we upload  a file named "a.jpg" at first time, and at next upload it is uploaded as "a_.jpg", and at the third time "a__.jpg", likewise the Underscore after the filename is increasing one time for each upload of the same image. For this i want to make the filename as yyyy-mm-dd-h-m-s (Current timetamp of the system), so that for each upload we will get a different filename of same image.

How to rename the uploaded filename in django...

Alex Koshelev

unread,
Nov 6, 2008, 8:01:02 AM11/6/08
to django...@googlegroups.com
Django uploading mechanism allow you to add date-bases values to path. See `upload_to` section in [1]

[1]: http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield
Reply all
Reply to author
Forward
0 new messages