Questions tagged [ftplib]

ftplib — FTP protocol client under Python programming language

ftplib is a python module which defines the class FTP and a few related items.

The FTP class implements the client side of the FTP protocol. You can use this to write Python programs that perform a variety of automated FTP jobs, such as mirroring other ftp servers. It is also used by the module urllib.request to handle URLs that use FTP. For more information on FTP (File Transfer Protocol), see Internet RFC 959.

Read more about ftplib at python docs..

681 questions
5
votes
1 answer

Append data to file on FTP server in Python

I'm appending values to a log file every 6th second. Every 30 sec I'm transferring this log to an FTP server as a file. But instead of transfering the whole file, I just want to append the collected data to the file on my server. I haven't been able…
Christian
  • 1,548
  • 2
  • 15
  • 26
5
votes
3 answers

Python ftplib - uploading multiple files?

I've googled but I could only find how to upload one file... and I'm trying to upload all files from local directory to remote ftp directory. Any ideas how to achieve this?
Phil
  • 3,628
  • 8
  • 34
  • 36
4
votes
1 answer

Syncing directories with python's ftplib

I'm learning python and trying to write a code to sync two directories: one is on ftp server, the other is on my local disk. So far, I wrote a working code but I have a question or two about it :) import os from ftplib import FTP h_local_files = []…
errata
  • 5,695
  • 10
  • 54
  • 99
4
votes
1 answer

Handling disconnects in Python ftplib FTP transfers file upload

How can I handle disconnects in ftplib? I wrote a Python scrip that I will use in order to upload very big files to an FTP server using ftplib. My question is: Seeing as upload will probably take a lot of time due to the file's size, what if the…
4
votes
1 answer

Accessing FTP server with Python fails with "getaddrinfo" error

I am trying to access the open DLP Test FTP server as a practice. I keep getting a getaddrinfo error but I am unsure of where I'm going wrong. I am using Python 2 on a Windows 10, and have already checked that I am not behind a proxy. Code: from…
pgan16
  • 45
  • 4
4
votes
2 answers

MD5 value for file in a remote FTP server using Python ftplib

Once transferring a file to a server using ftplib, how do I determine the MD5 of that file to the one in my local server? from ftplib import FTP import hashlib ftp =…
4
votes
1 answer

FTP error "500 Illegal PORT command" while trying to connect from a dockerized Python script

I've created a Python Flask script which moves some file from an FTP server to another when certain condition happens. (both the FTP servers are in two different Docker) On my local machine the script works fine but when I try to put it in a Docker…
Lorenzo Cavada
  • 71
  • 1
  • 1
  • 10
4
votes
1 answer

Python FTP: "TimeoutError: [Errno 110] Connection timed out" but I can connect with sftp in terminal

I'm getting error while connecting to FTP in Python: server.connect('68.183.91.171') File "/usr/lib/python3.6/ftplib.py", line 152, in connect source_address=self.source_address) File "/usr/lib/python3.6/socket.py", line 724, in…
Satyajit Barik
  • 65
  • 1
  • 2
  • 9
4
votes
2 answers

How to connect remote Python FTP server to local Python FTP client

I am using python FTP server and client program. My need is to run Python FTP server on a remote machine that is connected on the same network as my local machine. FTP client will run from local machine, I need to connect FTP server with my FTP…
Lokesh Singh
  • 75
  • 2
  • 10
4
votes
1 answer

Connecting with ftplib via FTP proxy in Python?

I am trying to download files from FTP. It works fine at home but it doesn't work when I run through company's network. I know there is something to do with proxy. I have looked at a few posts regarding the proxy issue in Python. I have tried to set…
Karen Chen
  • 65
  • 1
  • 7
4
votes
3 answers

Python ftplib WinError 10060

I am learning to retrieve files from an ftp server using ftplib from this link : https://docs.python.org/2/library/ftplib.html When i run this code from ftplib import FTP ftp = FTP('ftp.debian.org') ftp.login() I get TimeoutError: [WinError…
4
votes
1 answer

Python: retrieving multiple files from an FTP server

[] I have little problem when trying to get some files from an FTP server using a Python script. I've searched for this, but without success. This is what I have known: session2.cwd("/archive") maps = session2.nlst() opslagplaats = input("waar wil…
Tboske
  • 59
  • 5
4
votes
1 answer

Python ftplib.error_perm 550: No such file or directory?

I've written a Python script that is part of my attempt to automate daily ftp transfers from my server. I've tested the script with a number of files and file types (html, mp3, png, jpg, etc.) and everything seems to work out fine so far. However,…
St4rb0y
  • 317
  • 3
  • 5
  • 22
4
votes
4 answers

Prevent ftplib from Downloading a File in Progress?

We have a ftp system setup to monitor/download from remote ftp servers that are not under our control. The script connects to the remote ftp, and grabs the file names of files on the server, we then check to see if its something that has already…
UberJumper
  • 20,245
  • 19
  • 69
  • 87
4
votes
1 answer

How do I upload full directory on FTP in python?

I have to upload a directory, with subdirectories and files inside, on a FTP server. But I can't seem to get it right. I want to upload the directory as it is, with it's subdirectories and files where they were. ftp =…
Beta_K
  • 69
  • 1
  • 2
  • 10