Tk Library Source Code

View Ticket
Login
Ticket UUID: 611595
Title: file upload support + fix for binary
Type: Patch Version: None
Submitter: stevecassidy Created on: 2002-09-19 13:51:22
Subsystem: ncgi Assigned To: andreas_kupries
Priority: 8 Severity:
Status: Closed Last Modified: 2003-06-18 23:22:52
Resolution: Accepted Closed By: andreas_kupries
    Closed on: 2003-06-18 16:22:52
Description:
the attached path adds two functions to ncgi to support
file upload. ncgi::import_file gives information about
an uploaded file (modelled on the cgi.tcl interface but
adds a -data option to get the data without writing it
to a local file)  ncgi::tempfile is used to generate a
temporary filename, maybe that belongs in fileutils. 

I've also fixed a bug (I think) relating to uploading
binary files which is to put stdin into -translation
binary -encoding binary before reading the form data.
Without this I was seeing translation of cr to nl cr in
the uploaded data.  The changed version passes the test
suite no problem but then so does the original so the
binary test obviously isn't triggering this bug. 
haven't got time just now to put together a test that
does trigger the bug, sorry.
User Comments: andreas_kupries added on 2003-06-18 23:22:52:
Logged In: YES 
user_id=75003

The patch has been integrated, with some small changes.

stevecassidy added on 2003-06-17 07:39:24:

File Added - 53284: ncgi-import-fix.patch

Logged In: YES 
user_id=105411

ncgi::import_file had a bit of stray code in the previous
patch. This patch fixes that and adds some tests to
ncgi.test for import_file. It also changes the way that
binary file upload is tested so that it doesn't use external
files (multipart data is generated by procedures rather than
being read from formdata). This makes it robust against
newline munging of the formdata.txt file.

andreas_kupries added on 2003-04-26 01:13:23:
Logged In: YES 
user_id=75003

Integrated chunk for binary data too. This completes the 
integration.

andreas_kupries added on 2003-04-24 07:55:04:
Logged In: YES 
user_id=75003

Integrated most of the patch attached here:
* tempfile is in fileutil
* import_file added
The change in the order of env/urlStub decls (command 
urlStub) was ignored. I see no reason for that.

The change for binary was _not_ integrated yet.
The testsuite currently does not trigger anything because the 
command reads from stdin, which is empty when the 
testsuite is run.

When you are talking about form data, is that just the values 
for the various form elements, or could that be uploaded file 
data, in fill binary glory, ie. not xxx-encoded ?

stevecassidy added on 2002-09-19 20:51:22:

File Added - 31415: ncgi-upload.patch

Attachments: