I am trying to add date and time to the uploaded file.
If the filename is filename.xml then I would like to change the name to filename-<date>-<time>.xml
def handle_uploaded_file(self, f):
name = "static/uploads/{0}".format(f.name)
with open(name, 'wb+') as destination:
for chunk in f.chunks():
destination.write(chunk)
Any help is highly appreciated. Thanks in advance.
format(f.name)