Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: How to handle file uploads with http.server

Reply
Thread Tools

Re: How to handle file uploads with http.server

 
 
Gabriel Genellina
Guest
Posts: n/a
 
      03-17-2010
En Thu, 11 Mar 2010 07:30:24 -0300, Neil Blue <(E-Mail Removed)>
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/issue8077

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

http://groups.google.com/group/comp....752bd79d5f5d6/

--
Gabriel Genellina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to handle file uploads with http.server Neil Blue Python 0 03-11-2010 10:30 AM
Somebody uploads a file - put a button on to preview the file. Mufasa ASP .Net 2 12-21-2007 07:32 PM
File Handle Reading Blues: Rereading a File Handle for Input Dietrich Perl 1 07-22-2004 10:02 AM
file uploads with progress bar Todd Denlinger ASP .Net 8 10-24-2003 05:34 AM



Advertisments