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 Łukasz Rekucki, 14 years ago

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.

comment:2 by Brian Neal, 14 years ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top