Sep-06-2022, 11:01 PM
Hi,
What's the right syntax to connect to a ftp server and download a file?
The following code cannot find the file however, I can with a ftp client app.
TIA
What's the right syntax to connect to a ftp server and download a file?
The following code cannot find the file however, I can with a ftp client app.
TIA
ftp_server = "192.168.1.10" url_username = "user" url_pass = "pass" session = ftplib.FTP_TLS(ftp_server, url_username, url_pass) file = open('/home/pi/myip.php', 'rb') # file to download print(file)
Error:Traceback (most recent call last):
File "C:\SharedFiles\Python\practice\json_read_from_url.py", line 17, in <module>
file = open('/192.168.1.10t/myip.php', 'rb') # file to send
FileNotFoundError: [Errno 2] No such file or directory: '/192.168.1.10/myip.php'