Opened 14 years ago
Closed 14 years ago
#14416 closed (worksforme)
ImageField forms require an enctype, not documented
Reported by: | Andy Terra | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | |
Severity: | Keywords: | ImageField enctype form HTML | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Well, this may very well not be a Django issue, but I can't help but suggest that this small caveat be documented somewhere.
Forms with ImageField require an enctype attribute such as <form enctype="multipart/form-data" method="post" action="">. Yes, it's HTML, not Django. But frustrating nonetheless.
As you can see by reactions in http://stackoverflow.com/questions/680770/django-imagefield-not-working-properly-via-modelform many new developers have a tough time when dealing with this issue. I'm not bold enough to submit a documentation patch, but it should be fairly simple to explain.
Change History (2)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
This is documented: http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files. Description of both FileField and ImageField link to that page. There is also a link in "Working with forms" article.