#14787: Upload handler should pass errors on to forms.FileField
-------------------------------------+-------------------------------------
     Reporter:  intgr                |                    Owner:
         Type:  New feature          |  anubhav9042
    Component:  File                 |                   Status:  closed
  uploads/storage                    |                  Version:  master
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by timo):

 * status:  assigned => closed
 * resolution:   => wontfix


Comment:

 After looking into this, Anubhav and I don't see any easy way to pass
 errors from upload handlers to forms since at the time the handler
 exception is raised, you aren't inside a form to catch it.

 One thing I thought of would be to allow an exception raised during file
 upload parsing to be stored in `request.FILES` so it would be re-raised
 when you accessed the file's key later, but I'm wary of this complexity
 and not even sure it would work.

 Regarding `max_size` on `FileField`, it really should be the subject of a
 separate ticket and given it's possible to implement this yourself and
 available in 3rd party packages, I don't think there's an urgent need for
 it.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/14787#comment:18>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.9fe5a66ba19e095cd5344b0a12c0e2ad%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to