Uploading files from IE

Tim Williams (gmail) tdwdotnet at gmail.com
Wed Mar 22 18:53:39 EST 2006


On 22/03/06, AB <amy-g-art at cox.net> wrote:

> >
> > try something like this:
> > filename = os.path.basename(fullpathname)
>
> I tried the following with the same result:
> myName = ulImage.filename
> newFile = file (os.path.join(upload_dir, os.path.basename(myName)), 'wb')
>
> Any other ideas?  Seems like it shouldn't be a browser issue though...



In Karrigell,  this upload script works in IE and firefox,   and the basics
are similar to yours.

import os
f = _myfile.file # file-like object
dest_name = os.path.basename(_myfile.filename)
out = open('c:/WINNT/Profiles/tw/Desktop/webupload/'+dest_name,'wb')
# copy file
import shutil
shutil.copyfileobj(f,out)
out.close()
print "File Uploaded Succesfully" #print to browser

Maybe your cgi is returning something strange, have you tried some print
statements to see what's going on at various parts of the script ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060322/0ced7bdf/attachment.html>


More information about the Python-list mailing list