I have an input tag where the user has to upload a file. Right now if the user doesn't upload anything I do this in the main view:
if len(request.FILES) != 0:
data = request.FILES['some_file']
...do some work...
else:
return render(request, 'App/nofile.html' )
If there is no file I take the user the another page where it says that no file was uploaded and make him/her go back to the main page.
Is there a way that I can check if the user did not uploaded a file and not go to another page just show a PICTURE in the middle of the screen in that main page with the message?
NOT JUST A STRING MESSAGE, a picture with the message.
Maybe javascript is the answer but I know nothing about javascript.
Thanks in advance for any help.