Trying to use a very simple form to upload a file into a new class instance. I am expecting to have both files in request.FILES but it\'s empty. I am on the bun
old question, but somebody might still find this useful.
In order to have your files uploaded and showns in request.FILES, your form MUST contain enctype="multipart/form-data", eg:
otherwise your files will not be uploaded and your request.FILES will be empty.
BTW That's a common solution to a common error. Nevertheless, I still found myself in a situation with an empty FILES (and the file in the POST) when everything else was looking OK. I have the feeling it was a size limit but did not want to spend more time debugging, and just used request.raw_post_data. If ever somebody falls on this issue please add a comment (including precise django version!) and I'll try to debug more deeply.