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
2
votes
0 answers

Upload Write stream to ftp server with Node JS

I've building an application using sockets where user can upload huge files from frontend. I'm saving the file in chunks into temp folder so that i can combine all the file once the upload is done and move to original location. But I want to move…
Mr.Throg
  • 925
  • 6
  • 21
2
votes
2 answers

Read FTP file contents in Python and use it at the same time for Pandas and directly

I am trying to download a file from an FTP server in memory, transform it to a dataframe but also return it as bytes. Code as follows: import io import pandas as pd from ftplib import FTP ftp_connection.cwd(ftp_folder) download_file =…
DBa
  • 261
  • 1
  • 3
  • 11
2
votes
2 answers

Is there a special trick to downloading a zip file and writing it to disk with Python?

I am FTPing a zip file from a remote FTP site using Python's ftplib. I then attempt to write it to disk. The file write works, however most attempts to open the zip using WinZip or WinRar fail; both apps claim the file is corrupted. Oddly however,…
ApplePieIsGood
  • 3,731
  • 6
  • 35
  • 51
2
votes
1 answer

FTP download with text label showing the current status of the download

I made a GUI in which after I click "Download" button the program will download files from FTP server. When doing that I want the label to update e.g: "Connecting..." -> "Downloading..." -> "Downloaded!" I tried doing it with threading module but it…
Qiasm
  • 356
  • 6
  • 15
2
votes
1 answer

FTP downloading freezes the whole application

I'm trying to download a file from FTP server which is about 100 MB. It's a test .bin file because I'm testing the app and I guess the files I will want to download in the future will weight even more. When I want to download the file the whole…
Qiasm
  • 356
  • 6
  • 15
2
votes
0 answers

Python: How to open files through Ftp with UTF-8/Unicode name?

I want to connect to an FTP server and get files and iterate through items with python. but folder names are Persian/Arabic and when I want to open any folder it returns this : error_perm: 550 The filename, directory name, or volume label syntax…
hossein hayati
  • 1,088
  • 2
  • 15
  • 34
2
votes
1 answer

Changing directory of FTP server (ftplib, pyftpdlib)

I am attempting to create client/server FTP via Python libraries pyftpdlib and ftplib. I have created a server as follows: from pyftpdlib.authorizers import DummyAuthorizer from pyftpdlib.handlers import FTPHandler from pyftpdlib.servers import…
Moondra
  • 4,399
  • 9
  • 46
  • 104
2
votes
1 answer

How to read the header of WAV file from FTP directly without downloading whole file in Python?

I want to read the WAV file (which is in my FTP server) directly from FTP server without downloading it into my PC in Python. Is it possible and if yes the how? I tried this solution Read a file in buffer from ftp python but it didn't work. I have…
paras jain
  • 45
  • 1
  • 6
2
votes
1 answer

Python progressbar for FTP downloads not working

I'm trying to use progressbar to display the FTP file download progress (ftplib) but the progress does not update correctly. The speed starts out high then gradually decreases (down to bytes). The download ends up completing after a few seconds…
enzobruno
  • 115
  • 1
  • 8
2
votes
1 answer

When using ftplib in Python 3.7, what is the proper way to detect if an ftp connection is closed or unopened?

Based on the docs and all previous SO questions, the code here should work properly, but isn't. Couldn't find any duplicates. If there are, my bad. Basically, after calling ftp.quit() on a valid ftp connection, subsequent attempts to test whether it…
Rick C137
  • 21
  • 4
2
votes
1 answer

Looping through files in ftp using ftplib returns "No such file or directory" in second loop

I am trying to loop through the files on the ftp and then store them. However, on the second iteration, I receive the error: FileNotFoundError: [Errno 2] No such file or directory: Here is my code: # TODO: auth from ftplib import FTP def…
WJA
  • 6,676
  • 16
  • 85
  • 152
2
votes
2 answers

Find out differences between directory listings on time A and time B on FTP

I want to build a script which finds out which files on an FTP server are new and which are already processed. For each file on the FTP we read out the information, parse it and write the information we need from it to our database. The files are…
Rune
  • 61
  • 5
2
votes
1 answer

Checking FTP connection is valid using NOOP command

I'm having trouble with one of my scripts seemingly disconnecting from my FTP during long batches of jobs. To counter this, I've attempted to make a module as shown below: def connect_ftp(ftp): print "ftp1" starttime = time.time() retry…
wonk
  • 92
  • 1
  • 10
2
votes
1 answer

Retrieve data from gz file on FTP server without writing it locally

I would like to retrieve the data inside a compressed gz file stored on an FTP server, without writing the file to the local archive. At the moment I have done from ftplib import FTP import gzip ftp = FTP('ftp.server.com') ftp.login() …
Luca
  • 1,610
  • 1
  • 19
  • 30
2
votes
2 answers

Creating year / month / day folder structure with Python in FTP

I'm looking for the option to create a year / month / day folder structure with the Python ftplib module Connection: ftp = ftplib.FTP(ftp_servidor, ftp_usuario, ftp_clave) Loading variables: ftp_raiz = 'TEST/' filename =…
Alejandro
  • 21
  • 6