[mod_python] ValueError with Flash 8 FileReference.upload(url)

Harold J. Ship Harold at giant-steps-networks.com
Thu Apr 6 02:52:22 EDT 2006


 
Attached output.

LS0tLS0tLS0tLS0tYWUwZ0w2YWUwY0gyS003YWUwY0gySWo1ZWk0ZWk0DQpDb250ZW50LURp
c3Bv
c2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9IkZpbGVuYW1lIg0KDQpzYW1wbGUudHh0DQotLS0t
LS0t
LS0tLS1hZTBnTDZhZTBjSDJLTTdhZTBjSDJJajVlaTRlaTQNCkNvbnRlbnQtRGlzcG9zaXRp
b246
IGZvcm0tZGF0YTsgbmFtZT0iRmlsZWRhdGEiOyBmaWxlbmFtZT0ic2FtcGxlLnR4dCINCkNv
bnRl
bnQtVHlwZTogYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtDQoNClN0YXJ0IG9mIFNhbXBsZSBU
ZXh0
IEZpbGUgQ29udGVudHMNCkVuZCBvZiBTYW1wbGUgVGV4dCBGaWxlIENvbnRlbnRzDQoNCi0t
LS0t
LS0tLS0tLWFlMGdMNmFlMGNIMktNN2FlMGNIMklqNWVpNGVpNA0KQ29udGVudC1EaXNwb3Np
dGlv
bjogZm9ybS1kYXRhOyBuYW1lPSJVcGxvYWQiDQpTdWJtaXQgUXVlcnkNCi0tLS0tLS0tLS0t
LWFl
MGdMNmFlMGNIMktNN2FlMGNIMklqNWVpNGVpNA==


-----Original Message-----
From: Graham Dumpleton
Sent: Wednesday, April 05, 2006 11:57 PM
To: Harold J. Ship
Cc: Jim Gallacher; mod_python at modpython.org
Subject: Re: [mod_python] ValueError with Flash 8
FileReference.upload(url)


If it isn't formatted per the standards for how multipart forms are
meant to be formatted, that it may be accepted on platform does not
matter as there are no guarantees it will be accepted on another.

Anyway, to settle this, capture your post data again using that handler,
but change the handler to:

from mod_python import apache
import base64

def handler(req):

     data = open("/some/path/post.dat", "wb")
     data.write(base64.encodestring(req.read()))
     data.close()

     req.content_type = 'text/plain'
     req.write("Done")

     return apache.OK

By encoding it as base64 before being sent, we know for sure that
nothing about how it was written to file or dealt with by any mail
software will stuff up CR LF sequences and we can see exactly what was
received.

Graham

-------------- next part --------------
A non-text attachment was scrubbed...
Name: post.dat
Type: application/octet-stream
Size: 657 bytes
Desc: post.dat
Url : http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060406/f98a7a3a/post.obj


More information about the Mod_python mailing list