[mod_python] problem in file download

Johnny Morano johnny.morano at vlaanderen.be
Thu Jun 6 08:46:05 EST 2002


On Wednesday 05 June 2002 18:45, you wrote:
> getattr(file, name)

is this possible on windows? i thought you could only do that on UNIX 
systems... well, that's the case in php at least. please correct me if i'm 
wrong.

could you maybe show the python code for handling the upload? i've written a 
few upload scripts as well, maybe we can share them ;-)

i usually use the req object too. like:

def insertFile(req):
	form = req.form
	fileObject = form['fileInputField']
	fileData = fileObject.file.read()
	open('/some/path/name/file','wb').write(fileData)

well, this is the very simple fileUploadThing

greetz,
johnny

-- 
Johnny Morano - Linux Consultant
___________________________________________________ 
 Ministerie Vlaamse Gemeenschap                    |
 Koning Albert II-laan, 7 (610) 1210 Brussel       |
 tel: 02/5531319 mail: johnny.morano at vlaanderen.be |



More information about the Mod_python mailing list