No

Gerard Flanagan grflanagan at yahoo.co.uk
Wed Feb 22 13:05:43 EST 2006


Gaz wrote:
> (the Input type = FILE is in the field)
>
> please check this out
>
> import ftplib
> import os
>
> ...
>
>     def upload(ftp, file):
>         ext = os.path.splitext(file)[1]
>         if ext in (".txt", ".htm", ".html"):
>             ftp.storlines("STOR " + file, open(file))
>         else:
>             ftp.storbinary("STOR " + file, open(file, "rb"), 1024)
>
>     ftp = ftplib.FTP("ftp.XXXX.f2o.org")
>     ftp.login("XXXXX", "XXXXX")
>
>     upload(ftp, "c:\check.jpg")
>
> I'm still getting the file not found error:
>
> http://img153.imageshack.us/img153/2720/error3ps.jpg
>
> I believe the path is kinda wrong or something. But this time, the
> script is supposed to fetch the file from my pc.

Gaz

Google "file upload cgi".

Gerard




More information about the Python-list mailing list