Chris Dewin wrote: > chunk = fileitem.file.read(100000), and fout.write (chunk) seem to be the > key statements. Could someone elaborate on these for me please? And why > do they need to be in a while loop?
I imagine that the intention of reading only 100000 bytes at a time is to limit the amount of memory used by the process. In an environment where the process is kept around (not CGI, however) doing so might be critical since it has been alleged that Python isn't particularly good at freeing memory back to the operating system. One way of limiting the total size of uploaded files might be to examine the "Content-Length" header and to reject (ie. not process) uploads involving files above a certain size. Paul -- http://mail.python.org/mailman/listinfo/python-list