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
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