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

socket.gaierror: [Errno 8] nodename nor servname provided, or not known

I'm trying to connect to my ftp server with the following Python script on a Mac running OS X Yosemite (10.10.5): from ftplib import FTP import ConfigParser config_file = "ftp.config" config = ConfigParser.ConfigParser() try: …
St4rb0y
  • 317
  • 3
  • 5
  • 22
4
votes
2 answers

FTP upload error with Python and ftplib.

I'm trying to run a simple ftps script to upload a file on a scheduled basis from a Linux box to a ftps instance running on Windows Server 2012. When I try and test the script on my desktop (OS x), the script errors out: Error uploading file:…
Cesar
  • 423
  • 5
  • 14
4
votes
2 answers

ftplib.FTP timeout has inconsistent behaviour

I am trying to use ftplib.FTP() with timeout option as some timeout value for a particular hostname. But i am experiencing weird behaviour. To test it i have written a very simple piece of code. import ftplib from ftplib import FTP ftp =…
Tejendra
  • 1,874
  • 1
  • 20
  • 32
4
votes
1 answer

ftplib.error_perm: 550 Not enough privileges while STORing files as anonymous user

I created a python FTP client and a server. I used python pftpdlib for the server and ftplib for client. I was able to start the server successfully and connect to the server through the python client. But, when I need to store a file in the server,…
Deepal
  • 1,729
  • 5
  • 24
  • 34
4
votes
3 answers

Get all filenames inside a directory on FTP [Python]

Today I ran into a big problem and because I'm fairly new with Python I'm really going to need to ask for help. I've managed to connect to my FTP and login correctly. ftp = ftplib.FTP('ftp.lala.com', 'username', 'pass') As a second step I move into…
Yenthe
  • 2,313
  • 5
  • 26
  • 46
4
votes
2 answers

Created Date of file via ftp

Good Day! How to get created date of a file via ftp?. Im using web2py,python,ftplib and filezilla as a ftp server. I can get the modified date via f.sendcmd('MDTM '+filename). Any suggestions? Thanks!
user3005006
  • 41
  • 1
  • 2
4
votes
2 answers

Python ftplib: low download & upload speeds when using python ftplib

I was wondering if any one observed that the time taken to download or upload a file over ftp using Python's ftplib is very large as compared to performing FTP get/put over windows command prompt or using Perl's Net::FTP module. I created a simple…
Tanmoy Dube
  • 91
  • 1
  • 7
4
votes
2 answers

python ftplib weird behaviour

I'm running into some very strange behaviour when trying to connect to a ftp server using ftplib. What I'm doing is: import ftplib ftp = ftplib.FTP('my-ftp-server') ftp.login('user ', 'pass') Now if I run these from a python interpreter it work…
Bogdan
  • 8,017
  • 6
  • 48
  • 64
4
votes
2 answers

ftplib, how to manage exception without errno attribute?

I want to upload a file on an ftp site if the file is not present. This is a task of a more complex application, but it's not important in this case. My idea is to check if the file is present with the FTP.size(filename) method and if the error is…
BigDie
  • 51
  • 3
4
votes
2 answers

Python module ftplib FTP_TLS - Error 530

I'm using Python 2.7 on ubuntu 11.10 distribution. I have a problem with ftplib module and FTP_TLS connection. On my ftp server there is vsftp When try a connection I receive this error: ftplib.error_perm: 530 Please login with USER and PASS. This…
Antonio-Dev
  • 43
  • 1
  • 6
4
votes
6 answers

Delete all files and folders after connecting to FTP

I want to connect through FTP to an address and then delete all contents. Currently I am using this code: from ftplib import FTP import shutil import os ftp = FTP('xxx.xxx.xxx.xxx') ftp.login("admin", "admin") for ftpfile in ftp.nlst(): if…
Adrian
  • 19,440
  • 34
  • 112
  • 219
3
votes
1 answer

GCP Composer - ftplib timeouterror errno 110 connection timed out

I trying to getting data from FTP server's txt file by GCP Composer Tasks. So i imported and used ftplib package in code. like this. ftp = FTP() ftp.connect(host=HOST,port=PORT,…
박현균
  • 59
  • 1
  • 5
3
votes
1 answer

Deploy to FTP via python script with GitLab CI

I'm new to GitLab. I am building my first pipeline to deploy the contents of my GitLab project to an FTP server with TLS encryption. I've written a Python script using ftplib to upload the files to the FTP server that works perfectly when I run it…
ionosphere
  • 373
  • 2
  • 13
3
votes
2 answers

Reading files from FTP server to DataFrame in Python

I would like to load a file from an FTP server into Pandas dataframe without downloading it to disk first. I have written a script that executes this command but with downloading to disk. Is this possible in the ftplib library? Do you see any…
babel113
  • 59
  • 5
3
votes
1 answer

ftplib change file remotely

I have some file remotely : ___________ [somevar] Test: 2 ___________ And i want to change var "Test" to 3 for example so i will have : ___________ [somevar] Test: 3 ___________ I'm using this function to upload file ftp = ftplib.FTP('') …
BlackRoot
  • 33
  • 5