On Wed, 11 Oct 2000 15:41:16 -0700 (PDT), knight <knight@righteous.net> wrote:
infilename = REQUEST.form['attached_file'].filename # Get filename infile = REQUEST.form['attached_file'] # Get the file descriptor myheader = infile.read(500) # Read up to 500 bytes infile.close() # Close the stream
This should be in an external method or product.
I haven't tested whether or not this will only let the client upload the first 500 bytes
Im sure it wont
it's very possible zope takes in the entire file, and puts it into a buffer that is like a file descriptor (hence StringIO).
File uploads are spooled into a temporary file, and the request is only dispatched into Zope once the whole request has arrived. Anything smarter than that will require some ZServer hacking. Toby Dickenson tdickenson@geminidataloggers.com