Re: [Django] #15879: multipart/form-data filename="" not handled as file

2011-04-21 Thread Django
#15879: multipart/form-data filename="" not handled as file
+--
   Reporter:  j@…   |  Owner:  nobody
   Type:  Bug   | Status:  new
  Milestone:|  Component:  File uploads/storage
Version:  1.3   |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  1
Needs documentation:  0 |Needs tests:  1
Patch needs improvement:  1 |  Easy pickings:  0
+--
Changes (by carljm):

 * needs_docs:   => 0
 * needs_better_patch:   => 1
 * has_patch:  0 => 1
 * needs_tests:   => 1
 * stage:  Unreviewed => Accepted


Comment:

 Patch doesn't look quite right, based on the description - if there is no
 filename parameter it would be None, and the current code would skip it
 (continue) but the new could would not.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #15879: multipart/form-data filename="" not handled as file

2011-04-21 Thread Django
#15879: multipart/form-data filename="" not handled as file
-+--
 Reporter:  j@…  |  Owner:  nobody
 Type:  Bug  | Status:  new
Milestone:   |  Component:  File uploads/storage
  Version:  1.3  |   Severity:  Normal
 Keywords:   |   Triage Stage:  Unreviewed
Has patch:  0|  Easy pickings:  0
-+--
 Django does not parse file uploads with empty filename as file objects in
 multipart/form-data requests.
 This happens currently if you try to upload a Blob in Firefox 4
 (https://bugzilla.mozilla.org/show_bug.cgi?id=649150)
 Firefox sends this:
 {{{
 Content-Disposition: form-data; name="fieldname"; filename=""
 Content-Type: content/type
 DATA
 }}}

 Reading the related RFCs there is no mention that filename="" is not
 allowed and the existence of the filename parameter should be enough to
 treat it as a file.
 looking at django/http/multipartparser.py
 165ff
 {{{
 file_name = disposition.get('filename')
 if not file_name:
 continue
 }}}
 this would need to set a default filename instead of bailing out
 (i.e. if file_name == '': file_name = 'data.bin)

 590:
 {{{
 if params.get('filename'):
 }}}
 this would need to check
 {{{
 if 'filename' in params:
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.