#32004: Improve documentation of request.FILES --------------------------------------+------------------------------------ Reporter: Janos Roden | Owner: nobody Type: Cleanup/optimization | Status: new Component: Documentation | Version: 3.1 Severity: Normal | Resolution: Keywords: upload | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 --------------------------------------+------------------------------------
Comment (by Janos Roden): Hi Carlton, I'm thinking about [https://docs.djangoproject.com/en/3.1/topics/http /file-uploads/#basic-file-uploads this] section: Note that `request.FILES` will only contain data if the request method was `POST` and the `<form>` that posted the request has the attribute `enctype="multipart/form-data"`. Otherwise, `request.FILES` will be empty. Could be extended as Note that `request.FILES` will only contain data from form fields if the request method was `POST` and the `<form>` that posted the request has the attribute `enctype="multipart/form-data"` and contains at least one `<intput type="file">` field. Or more technically if request method was `POST`, the `Content-Type` general header was `multipart/form-data` and the `Content-Disposition` subpart header contains the `filename` parameter (default behavior in browsers for this `enctype`). Otherwise, `request.FILES` will be empty. Feel free to correct my english, please. I hope it isn't too complicated, what do you think? -- Ticket URL: <https://code.djangoproject.com/ticket/32004#comment:4> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.a2fb766a57b30c12b14cf1fec75a6f4d%40djangoproject.com.