Message3220
Ah, I see; the traceback makes this much clearer. When you're uploading a file, everything in the form is sent as
a MIME document in the body; every field is accompanied by
a boundary separator and Content-Disposition header.
In multipart mode, cgi.py copies each field into a temporary file.
The first idea I had was to only use tempfiles for the actual upload field; unfortunately, that doesn't help because the upload field isn't special, and cgi.py has no way to know which it is ahead of time.
Possible second approach: measure the size of the resulting file; if it's less than some threshold (1K? 10K?), read its contents into memory and close the tempfile. This means only the largest fields will require that a file descriptor be kept open. I'll explore this more after beta1.
|
|
Date |
User |
Action |
Args |
2007-08-23 13:53:03 | admin | link | issue231249 messages |
2007-08-23 13:53:03 | admin | create | |
|