Thanks Gabriel
Yep, that looks like the same one.
Cheers
Neil
-Original Message-
From: Gabriel Genellina [mailto:gagsl-...@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
En Thu, 11 Mar 2010 07:30:24 -0300, Neil Blue
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.
Hello,
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/
On Mar 2, 2010, at 4:48 PM, I wrote:
Can someone tell me how to upload the contents of a (relatively
small) file using an HTML form and CGI in Python 3.1? As far as I
can tell from a half-day of experimenting, browsing, and searching
the Python issue tracker, this is broken.
followed by
Can someone tell me how to upload the contents of a (relatively small)
file using an HTML form and CGI in Python 3.1? As far as I can tell
from a half-day of experimenting, browsing, and searching the Python
issue tracker, this is broken. Very simple example:
http://localhost
"Jesse Noller" <[EMAIL PROTECTED]> writes:
> Hey All,
>
> I'm working on an script that will generate a file of N size (where N is
> 1k-1gig) in small chunks, in memory (and hash the data on the fly) and pass
> it to an httplib object for upload. I don't want to store the file on the
> disk, or c
Jesse Noller wrote:
> Hey All,
>
> I'm working on an script that will generate a file of N size (where N is
> 1k-1gig) in small chunks, in memory (and hash the data on the fly) and
> pass it to an httplib object for upload. I don't want to store the file
> on the disk, or completely in memory a
Hey All,I'm working on an script that will generate a file of N size (where N is 1k-1gig) in small chunks, in memory (and hash the data on the fly) and pass it to an httplib object for upload. I don't want to store the file on the disk, or completely in memory at any time. The problem arises after
Doug Helm wrote:
> I'm writing a CGI to handle very large file uploads.
> I would like to include a progress bar.
> ...I need to know not only the number of
> bytes received, but also the total number of
> incoming bytes. Here's the heart of the code:
>
> So, bottom line: Does anyone know how to get the size of the incoming file
> data without reading the whole thing into a string? Can I do something with
> content_header?
http://www.faqs.org/rfcs/rfc1867.html
It seems that _maybe_ you can use the content-length http header. But it
looks as if
Hey, Folks:
I'm writing a CGI to handle very large file uploads. I would like to
include a progress bar. I think I'm about done. I have code to handle the
file upload, and I think I can add an IFrame to my page which posts to check
file size (so I can tell how many bytes have bee
You're right, of course, and I do appreciate it. I generally am calling
functions and returning strings and then printing the entire string.
For example:
def SomeFunc():
lstrRetVal = ''
lstrRetVal += 'Content-type: text/html\n\n'
lstrRetVal += more HTML here...
return lstrRetVal
Then, th
"Doug Helm" <[EMAIL PROTECTED]> wrote:
>Hey, Folks:
>
>I'm trying to write a very simple file upload CGI. I'm on a Windows server.
>I *am* using the -u switch to start Python for CGIs, as follows:
>
>c:\python\python.exe -u %s %s
>
>I *do* have write permissions on the directory I'm trying to wri
Andrew:
I'm a dope. You're brilliant. Thank you. That worked splendidly.
Doug
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Doug Helm wrote:
>
> > form = cgi.FieldStorage()
> > if lobjUp.Save('filename', 'SomeFile.jpg'):
>
> > class BLOB(staticobject.StaticObject):
> > def
Doug Helm wrote:
I'm not getting any error. I submit a multi-part form to save a file
attachment to disk, and the post just hangs.
You really should look into debugging this. Are you sure your script
is called? To be sure, make the script create a file in c:\tmp.
Is the file being created?
Next, y
Doug Helm wrote:
> form = cgi.FieldStorage()
> if lobjUp.Save('filename', 'SomeFile.jpg'):
> class BLOB(staticobject.StaticObject):
> def Save(self, pstrFormFieldName, pstrFilePathAndName):
> form = cgi.FieldStorage()
You are instantiating cgi.FieldStorage twice. This won't work for POST
I should have been more clear in my subject line. I was also the poster in
the "File Uploads" topic. I'm not having any luck getting file uploads to
work (multi-part HTML form) on a Windows server. I'm using a very close
approximation of public domain code that I found. I&
No, I am on a Linux server. I am not sure how CGI is configured
because I do not control the server, I only use it.
bye,
Dimitri
On Sun, 27 Mar 2005 16:19:00 -0700, Doug Helm <[EMAIL PROTECTED]> wrote:
> Thanks, Dimitri. Yes, I found that same code too and tried it with the
> exact same result
Thanks, Dimitri. Yes, I found that same code too and tried it with the
exact same result as the code I've uploaded (just hangs). But, OK. You
have it working, so it must be a systems issue. Are you also on a Windows
IIS web server? Do you have CGI configured the same way (i.e. .py =
python.exe
Maybe this helps:
http://www.voidspace.org.uk/python/cgi.shtml#upload
I use it, it works for fine me
Maybe it will give you some clues on how to tweak your own script.
Dimitri
On Sun, 27 Mar 2005 10:32:20 -0700, Doug Helm <[EMAIL PROTECTED]> wrote:
> Hey, Folks:
>
> I'm trying to write a very
Hey, Folks:
I'm trying to write a very simple file upload CGI. I'm on a Windows server.
I *am* using the -u switch to start Python for CGIs, as follows:
c:\python\python.exe -u %s %s
I *do* have write permissions on the directory I'm trying to write to. But,
when I click submit, it just hangs.
21 matches
Mail list logo