This is my first post here, and i'd like to thank you in advance for any help you can provide.
While working on a python program to make HTML pages, i have encountered a problem when it comes to <br>
uploading the pages.
The 'sandbox' script which i am using to test my methods is:::
Expand|Select|Wrap|Line Numbers
- import sys, os, ftplib, MOD
- print"running"
- #oooo this is insert
- s = ftplib.FTP('ftp.members.lycos.co.uk','myusername','mypassword') # Connect
- print "Connect"
- ndsfile = r"c:\index.html"
- xnds = "STOR "+ndsfile
- f = open(ndsfile,'r') # file to send
- xcv=ftp.getwelcome()
- print xcv
- print xnds
- ftp.storlines('STOR index.html', f)
- f.close() # Close file and FTP
- s.quit()
- print "done!"
running
Connect
220 212.78.204.231 FTP server ready
STOR c:\index.html
Traceback (innermost last):
File "e:\Program Files\Python\Pythonwin\pywin\framework\scriptutils .py", line 301, in RunScript
exec codeObject in __main__.__dict__
File "C:\Documents and Settings\dave\Desktop\ftplearn1.py", line 12, in ?
ftp.storlines('STOR index.html', f)
File "e:\Program Files\Python\Lib\ftplib.py", line 374, in storlines
self.voidcmd('TYPE A')
File "e:\Program Files\Python\Lib\ftplib.py", line 232, in voidcmd
self.putcmd(cmd)
File "e:\Program Files\Python\Lib\ftplib.py", line 162, in putcmd
self.putline(line)
File "e:\Program Files\Python\Lib\ftplib.py", line 157, in putline
self.sock.send(line)
File "<string>", line 1, in send
error: (10053, 'winsock error')
>>>
As can be seen the program shows the welcome message from the server, so i know that the <br>
connection is ready, and i have used examples from all over the WWW to try<vr>
to correct the upload problem.
I am running version 1.5.2+ of pythonwin on XP service pack 2 with avast <br>
antivirus ( i am unsure if the windows firewall is working due to a current <br>problem with the WMI!)
ANy help or suggestions will be hugely appreciated!