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

Read CSV over FTP line by line without storing the whole file in memory/disk

I'm stuck piping ftplib.FTP.retrlines to csv.reader... FTP.retrlines repeatedly calls a callback with a line in it, while csv.reader expects an iterator which returns a string each time its __next__() method is called. How do I combine the two…
neurino
  • 11,500
  • 2
  • 40
  • 63
3
votes
1 answer

FTPSHook Airflow (522 SSL/TLS required on the data channel)

I'm trying to use FTPSHook to send file through FTP TLS/SSL Explicit Encryption. Here's my code remote_filepath=pathfile local_filepath=pathfile2 hook = FTPSHook(ftp_conn_id='ftp_test') hook.store_file(remote_filepath, local_filepath) and I'm…
grace09
  • 33
  • 5
3
votes
2 answers

Is it possible to call xarray open_mfdataset on an FTP server?

I'm attempting to download a daily ocean temperature reanalysis product (GLORYS2V4 from CMEMS) for the North Atlantic, but the only download option is FTP access with large (2GB) global files. Is it possible to use open_mfdataset on an FTP directory…
jmason
  • 31
  • 1
3
votes
1 answer

Reading file from a ZIP archive on FTP server without downloading to local system

My target file on the FTP server is a ZIP file, and the .CSV is located two folders further in. How would I be able to use BytesIO to allow pandas to read the csv without downloading it? This is what I have so far: ftp =…
3
votes
4 answers

How to run Python script in FTP server using Python?

I want to run Python script located on server using another Python script with FTP. Below is my (hello.py) file location I want to run. from ftplib import FTP ftp = FTP('host') ftp.login(user='user', passwd = 'password') print("successfully…
Mahipal Singh
  • 144
  • 1
  • 11
3
votes
1 answer

Using Python, how to download multiple files from a subdirectory on FTP server into a desired directory on local machine?

Using python program, I was able to download multiple source files from a FTP server (using ftplib and os libraries) to my local machine. These source file resides at a particular directory inside the FTP server. I was able to download the source…
Mech_Saran
  • 157
  • 1
  • 2
  • 9
3
votes
1 answer

Sending files to client from server via socket/ftp python

I am new to python. Using Ubuntu 18.04, python 3.6. Tried writing a script to send ANY File from server to client (currently trying to send .pdf file) and vice versa. Earlier i used sockets to send file, but was facing problems with extensions…
KNF TV
  • 49
  • 4
3
votes
2 answers

Update PyQt progress from another thread running FTP download

I want to access progress bar's (which is in the Ui_MainWindow() class) setMaximum() from another class/thread (DownloadThread() class). I tried making DownloadThread() class inherit from Ui_MainWindow: DownloadThread(Ui_MainWindow). But when I try…
Qiasm
  • 356
  • 6
  • 15
3
votes
1 answer

Sending a file to a ftp server using ftplib

I'm trying to send a file to a ftp server using the ftplib library. I have tied two different approaches. 1st) from ftplib import FTP ftp = FTP('HOST') ftp.login('USERNAME','PASSWORD') On this case when I try to login I get the following…
gr7
  • 492
  • 3
  • 11
3
votes
0 answers

threaded 'NOOP' command during retrbinary

I've written an FTP script that must unfortunately deal with a server that's behind a firewall. The ISP also cuts of my control connection quite early, no matter what kind of timeout settings I might set on either side of the firewall. I've…
EmBee
  • 41
  • 2
3
votes
0 answers

Problem while trying to ftp file > 2GB using ftplib

I have an AWS Glue job in Python2.7 that is trying to ftp files from my s3 bucket to a client server. I am using pythons inbuilt ftplib library to do so. I am able to ftp the files as long as the file is less than 2GB. The moment the file size goes…
3
votes
1 answer

Error accessing ftp website with BeautifulSoup and ftlib

I am trying to access a webpage to download some data like this: from bs4 import BeautifulSoup import urllib.request from lxml import html download_url = "ftp://nomads.ncdc.noaa.gov/NARR_monthly/" s = requests.session() …
Stefano Potter
  • 3,467
  • 10
  • 45
  • 82
3
votes
1 answer

Show FTP download progress in Python (ProgressBar)

I am downloading files over FTP using the following Python script. What I wanted is to see the details of the progress while downloading. For that I used ProgressBar but it isn't showing anything. Here's my code: import re import os import…
Marshmellow
  • 111
  • 1
  • 11
3
votes
1 answer

Python ftplib and storbinary

Trying to understand how the ftplib works. I am trying to save a file to a FTP server and implement a callback. The documentation says: FTP.storbinary(command, file[, blocksize, callback, rest]) callback function is defined as in the…
user225312
  • 126,773
  • 69
  • 172
  • 181
3
votes
3 answers

ftplib storbinary with FTPS is hanging/never completing

I am trying to upload a file to an FTP site using FTPS, but when I attempt to store the file, it just hangs after the file is fully transferred. global f_blocksize global total_size global size_written f_blocksize = 1024 total_size =…
ryansin
  • 1,735
  • 2
  • 26
  • 49