How can i get file name from request.FILE in Django?
def upload(request):
if request.method == 'POST':
form = UploadForm(request.POST, request.FILES)
if form.is_valid():
upload = Upload()
upload.timestamp = datetime.datetime.now()
save_instance(form, upload)
I tied use this
if 'filename' in request.FILES:
filename = request.FILES['filename']
but it not work.
I need to get file name in variable