[Tutor] HTTP upload- Second try
Sharriff Aina
NHYTRO@compuserve.com
Fri, 23 Feb 2001 04:51:23 -0500
Hi Guys, I=B4m sorry to be a bore, but could someone tell my why my code
fails?
#### code follows ##
#!C:/Python/python.exe -u
print "Content-Type: text/html\n\n"
import cgi
#import os
#
#
form =3D cgi.FieldStorage()
if form.has_key('name'): # from <INPUT name=3D"newimage"...>
imageitem =3D form['name']
if imageitem.file:
contents =3D form['newimage']
tempthumb =3D open('.\medintouch\images\testimage.txt', 'w')
tempthumb.write(contents)
print "<br></br>"
print "<html><head><title>Image uploaded</title></head>"
print '<body>'
print "<br></br>"
print "saving Image file to disk..."
print "<br></br>"
print "<br></br>"
print '</body>'
print '</html>'
#### code end ##
The test file is nor written at all :-(
Thanks guys
Sharriff