[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

RE: How to handle file uploads with http.server

Neil Blue

3/17/2010 9:13:00 AM

Thanks Gabriel

Yep, that looks like the same one.

Cheers
Neil



-----Original Message-----
From: Gabriel Genellina [mailto:gagsl-py2@yahoo.com.ar]
Sent: 17 March 2010 02:08
To: python-list@python.org
Subject: Re: How to handle file uploads with http.server

En Thu, 11 Mar 2010 07:30:24 -0300, Neil Blue <Neil.Blue@biowisdom.com>
escribió:

> I have a basic http.server instance running (class
> HTTPHandler(http.server.BaseHTTPRequestHandler), with python 3.1, and
> I would like to upload files with multipart forms.
>
> def do_POST(self):
> ctype, pdict = cgi.parse_header(self.headers['Content-Type'])
> if ctype=='multipart/form-data':
> print('parsing...')
> query=cgi.parse_multipart(self.rfile, pdict)
> print(query)
>
> However the file never seems to finish being parsed. There are no
> errors, but the call hangs at: query=cgi.parse_multipart(self.rfile,
> pdict)

This may be related to this bug:

http://bugs.python.org...

reported last week by Mitchell L. Model in this thread:

http://groups.google.com/group/comp.lang.python/t/8a7752b...

--
Gabriel Genellina



*********************************************

The information contained in this message is likely to be confidential. It is intended only for the person named above. Any dissemination, distribution, copying, disclosure or use of this message or its contents unless authorised by BioWisdom Ltd is strictly prohibited. Any views or opinions expressed within this e-mail are those of the author and do not necessarily represent those of BioWisdom Ltd. If you have received this message in error, please immediately notify us and delete it. Thank you. Registered Office: BioWisdom Ltd, Harston Mill, Harston, Cambridge, CB22 7GG. Registered in England: (GB) 3861669. VAT registered: (GB) 750899881. Tel: +44 (0)1223 874800, Fax: +44 (0) 1223 874801, Internet:www.biowisdom.com

*********************************************