juliomalegria / django-chunked-upload

Upload large files to Django in multiple chunks, with the ability to resume if the upload is interrupted.
MIT No Attribution
218 stars 73 forks source link

strange code #26

Closed insideable closed 8 years ago

insideable commented 8 years ago

Hi, is the following code correct? strftime for filename looks a bit strange for me :) https://github.com/juliomalegria/django-chunked-upload/blob/master/chunked_upload/models.py#L23

juliomalegria commented 8 years ago

Hi @insideable, This is because the default UPLOAD_PATH is 'chunked_uploads/%Y/%m/%d'. We use time.strftime to fill those placeholders, or any others that could be set.

If the path doesn't vary by date, then time.strftime won't alter it:

time.strftime('helloworld') == 'helloworld'