Hi On windows XP (python 2.4.2) the latest svn checkout produces the following bug: FileSaver converts LF to CRLF automatically, even in binary files!! I tried to upload files with the following code: child_uploadfile = static.FileSaver(destination='d:/agreif/tmp', expectedFields=['filename'], maxBytes=10000000, allowedTypes=[http_headers.MimeType('text', 'x-python'), http_headers.MimeType('application','x-zip-compressed')]) here is the hexdump of two samples. You see that in front of every occurrance of "0A" a "0D" is inserted. Sample 1: textfile orig: 68616C6C6F0A uploaded: 68616C6C6F0D0A Sample 2 binary file (zip) orig: 504B03040A00000000001589FF34D13172B90500000005000000100000004E6575205465787464617465692E707968616C6C6F504B010214000A00000000001589FF34D13172B905000000050000001000000000000000010020000000000000004E6575205465787464617465692E7079504B050600000000010001003E000000330000000000 uploaded: 504B03040D0A00000000001589FF34D13172B90500000005000000100000004E6575205465787464617465692E707968616C6C6F504B010214000D0A00000000001589FF34D13172B905000000050000001000000000000000010020000000000000004E6575205465787464617465692E7079504B050600000000010001003E000000330000000000 Alex.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Alex, Please submit a bug at <http://twistedmatrix.com/trac>. The fix for this one is trivial, but it also needs a failing unit test. (The current tests would never have noticed this bug, which is indeed serious.) C Alex Greif wrote:
Hi
On windows XP (python 2.4.2) the latest svn checkout produces the following bug: FileSaver converts LF to CRLF automatically, even in binary files!!
I tried to upload files with the following code:
child_uploadfile = static.FileSaver(destination='d:/agreif/tmp', expectedFields=['filename'], maxBytes=10000000,
allowedTypes=[http_headers.MimeType('text', 'x-python'),
http_headers.MimeType('application','x-zip-compressed')])
here is the hexdump of two samples. You see that in front of every occurrance of "0A" a "0D" is inserted.
Sample 1: textfile orig: 68616C6C6F0A uploaded: 68616C6C6F0D0A
Sample 2 binary file (zip) orig: 504B03040A00000000001589FF34D13172B90500000005000000100000004E6575205465787464617465692E707968616C6C6F504B010214000A00000000001589FF34D13172B905000000050000001000000000000000010020000000000000004E6575205465787464617465692E7079504B050600000000010001003E000000330000000000
uploaded: 504B03040D0A00000000001589FF34D13172B90500000005000000100000004E6575205465787464617465692E707968616C6C6F504B010214000D0A00000000001589FF34D13172B905000000050000001000000000000000010020000000000000004E6575205465787464617465692E7079504B050600000000010001003E000000330000000000
Alex.
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEzjOR3A5SrXAiHQcRAjQMAJ49Y983MMvo/Quq3rnH3PGhvcIQWwCghSJY yXe/AiGyNMl/63jTfjZpqSE= =EEfu -----END PGP SIGNATURE-----
Hi Cory, at http://twistedmatrix.com/trac I see no button like "new ticket" for adding this defekt. I can only browse the tickets :( Do I need to login? If yes how can I register? to generate a unittest is quite easy, just create a file with a LF as line separator, and the uploaded file will hav a CR+LF. Alex. On 7/31/06, Cory Dodt <corydodt@twistedmatrix.com> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi Alex,
Please submit a bug at <http://twistedmatrix.com/trac>. The fix for this one is trivial, but it also needs a failing unit test. (The current tests would never have noticed this bug, which is indeed serious.)
C
Alex Greif wrote:
Hi
On windows XP (python 2.4.2) the latest svn checkout produces the following bug: FileSaver converts LF to CRLF automatically, even in binary files!!
I tried to upload files with the following code:
child_uploadfile = static.FileSaver(destination='d:/agreif/tmp', expectedFields=['filename'], maxBytes=10000000,
allowedTypes=[http_headers.MimeType('text', 'x-python'),
http_headers.MimeType('application','x-zip-compressed')])
here is the hexdump of two samples. You see that in front of every occurrance of "0A" a "0D" is inserted.
Sample 1: textfile orig: 68616C6C6F0A uploaded: 68616C6C6F0D0A
Sample 2 binary file (zip) orig: 504B03040A00000000001589FF34D13172B90500000005000000100000004E6575205465787464617465692E707968616C6C6F504B010214000A00000000001589FF34D13172B905000000050000001000000000000000010020000000000000004E6575205465787464617465692E7079504B050600000000010001003E000000330000000000
uploaded: 504B03040D0A00000000001589FF34D13172B90500000005000000100000004E6575205465787464617465692E707968616C6C6F504B010214000D0A00000000001589FF34D13172B905000000050000001000000000000000010020000000000000004E6575205465787464617465692E7079504B050600000000010001003E000000330000000000
Alex.
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEzjOR3A5SrXAiHQcRAjQMAJ49Y983MMvo/Quq3rnH3PGhvcIQWwCghSJY yXe/AiGyNMl/63jTfjZpqSE= =EEfu -----END PGP SIGNATURE-----
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
at http://twistedmatrix.com/trac I see no button like "new ticket" for adding this defekt. I can only browse the tickets :( Do I need to login?
Yes, that's right.
If yes how can I register?
What about the "Register" link, on the top right? :-) Remember to add your login name to the Cc: field of the ticket you create (or any other one you are interested in): you'll receive email at each change. -- Nicola Larosa - http://www.tekNico.net/ SOAP-based services are called "Web Services" because their proponents wish to partake of the Web's success -- yet they don't build on its core technologies, URIs and HTTP. Somehow many have equated SOAP and Web Services but HTTP has been in Service on the Web for more than a decade now and has not yet hit its prime. -- Paul Prescod, April 2002
thanks, the defect is now submitted :) Alex. On 8/1/06, Nicola Larosa <nico@teknico.net> wrote:
at http://twistedmatrix.com/trac I see no button like "new ticket" for adding this defekt. I can only browse the tickets :( Do I need to login?
Yes, that's right.
If yes how can I register?
What about the "Register" link, on the top right? :-)
Remember to add your login name to the Cc: field of the ticket you create (or any other one you are interested in): you'll receive email at each change.
-- Nicola Larosa - http://www.tekNico.net/
SOAP-based services are called "Web Services" because their proponents wish to partake of the Web's success -- yet they don't build on its core technologies, URIs and HTTP. Somehow many have equated SOAP and Web Services but HTTP has been in Service on the Web for more than a decade now and has not yet hit its prime. -- Paul Prescod, April 2002
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
thanks, the defect is now submitted :)
Alex.
Alex, Hi. It might be worth knowing that I was going to delete FileSaver, because the bugs are numerous and parts of it are just outright wrong (readIntoFile returns a deferred but it is a very sad and lonely deferred that has no one waiting on it.) Instead I plan to replace it with a minimal set of examples for handling form upload. The thing you want is likely far simpler than FileSaver and using FileSaver will likely only complicate matters. So if you'd like to ask some specific questions about handling file upload in web2 I'd be glad to help you move towards a non-FileSaver solution. -David
Hi David, I am a twisted newby, so I would be gald if you could present me a sample that can handle multipart file uploads up to 100 MB size. I searched in the archives, but found only a sample that blocked with "while True:" or that used the stream module. As I heard the stream module will disappear. So please support a correct and valid sample that makes no problems. Uploading files is essentioal on my site, so this would be a showstopper. Thanks, Alex On 8/1/06, dreid@dreid.org <dreid@dreid.org> wrote:
thanks, the defect is now submitted :)
Alex.
Alex, Hi.
It might be worth knowing that I was going to delete FileSaver, because the bugs are numerous and parts of it are just outright wrong (readIntoFile returns a deferred but it is a very sad and lonely deferred that has no one waiting on it.) Instead I plan to replace it with a minimal set of examples for handling form upload. The thing you want is likely far simpler than FileSaver and using FileSaver will likely only complicate matters. So if you'd like to ask some specific questions about handling file upload in web2 I'd be glad to help you move towards a non-FileSaver solution.
-David
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
participants (4)
-
Alex Greif
-
Cory Dodt
-
dreid@dreid.org
-
Nicola Larosa