FIXED - file upload with flash 8 uploader

1 view
Skip to first unread message

spako

unread,
Jul 7, 2006, 9:17:55 AM7/7/06
to Django users
i think... here's the patch:

/django/http/__init__.py

Index: __init__.py
===================================================================
--- __init__.py (revision 3287)
+++ __init__.py (working copy)
@@ -48,7 +48,7 @@
POST = MultiValueDict()
FILES = MultiValueDict()
for submessage in msg.get_payload():
- if isinstance(submessage, email.Message.Message):
+ if isinstance(submessage, email.Message.Message) &
submessage['Content-Disposition'] != None:
name_dict =
parse_header(submessage['Content-Disposition'])[1]
# name_dict is something like {'name': 'file', 'filename':
'test.txt'} for file uploads
# or {'name': 'blah'} for POST fields

Don Arbow

unread,
Jul 7, 2006, 12:23:18 PM7/7/06
to django...@googlegroups.com
Are you sure this is correct? You are using a bitwise '&' in your if statement. You probably meant &&, in Python you should be using the 'and' keyword.

Don

spako

unread,
Jul 8, 2006, 8:57:56 AM7/8/06
to Django users
i've had a look and did actually use the keyword 'and', i think i made
the patch in haste before i tested and corrected it, the patch should
be:

/django/http/__init__.py

Index: __init__.py
===================================================================
--- __init__.py (revision 3287)
+++ __init__.py (working copy)
@@ -48,7 +48,7 @@
POST = MultiValueDict()
FILES = MultiValueDict()
for submessage in msg.get_payload():
- if isinstance(submessage, email.Message.Message):

+ if isinstance(submessage, email.Message.Message) and


submessage['Content-Disposition'] != None:
name_dict =
parse_header(submessage['Content-Disposition'])[1]
# name_dict is something like {'name': 'file', 'filename':
'test.txt'} for file uploads
# or {'name': 'blah'} for POST fields

to note Malcom mentioned another fix for this in the original thread:
http://groups.google.com/group/django-users/browse_thread/thread/f0458e24fda970ab/49b7c48bbcfe24df#49b7c48bbcfe24df

Reply all
Reply to author
Forward
0 new messages