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

Python - writting unittest for functionality that uses remote access?

I have created this functionality where System regularly connects to remote location, checks specified directory and if it finds specific files in there, it imports data to system. Transfer functionality is implemented using paramiko and ftplib. So…
Andrius
  • 19,658
  • 37
  • 143
  • 243
2
votes
2 answers

Python ftplib with accent in file name : 501 Invalid character in command

I'm trying to upload a csv file including accents in the file name. Uploading the same file is working fine through Filezilla. My code is : session = ftplib.FTP('ftp.myserver.com','mylogin','mypass') file =…
user4453877
2
votes
1 answer

Python :raise error_perm, resp ftplib.error_perm: 500?

i'm trying to Copy my file from c:\test to my FTP folder ; This is my code : import ftplib import socket Name = socket.gethostname() filename = Name +".csv" ftp =…
Mehdi ouahabi
  • 67
  • 1
  • 2
  • 11
2
votes
1 answer

ftplib - move file to another directory? (with rename)

I run this: ftps.rename(rec.path+field_name, rec.archive_path+field_name)\ print 'passed' To move file to another directory as I need to archive it. This line of code runs fine, without errors (I also added print check to see if it really runs).…
Andrius
  • 19,658
  • 37
  • 143
  • 243
2
votes
2 answers

ftplib - 504 Security mechanism 'TLS' not implemented

I'm trying to connect to Secure FTP using ftplib, but it does not work for some reason (trying to connect to www.sharefile.com ftp. there it says to use this address: company.sharefileftp.com) I'm trying this approach (FTPES - FTP over explicit…
Andrius
  • 19,658
  • 37
  • 143
  • 243
2
votes
0 answers

Python FTP and Streams

I need to create a "turning table" platform. My server must be able to take a file from FTP A and send it to FTP B. I did a lot of file transfer systems, so I have no problem with ftplib, aspera, s3 and other transfer protocols. The thing is that I…
LeSuspect
  • 45
  • 5
2
votes
1 answer

Getting an error running FTP.retrbinary to retrieve a file

I'm using pythons ftplib to try and retrieve files off a remote server (practice project). I've had no issues sending files but getting an error when trying to retrieve. I'm using python 3. This is my code: from ftplib import FTP user =…
Marlone
  • 79
  • 2
  • 8
2
votes
3 answers

Python3 ftplib not fetching larger binary files

I have the following script to fetch files from a remote FTP site and download them locally: for i in ftp.nlst(): ftp.retrbinary("RETR " + i, open(local_file_path + "/" + i, "wb").write) The debug information shows that the file is being fetched,…
Brandon Davis
  • 63
  • 2
  • 8
2
votes
1 answer

Python FTP Directory Listing Hangs

After much searching on Google and reviewing many stackoverflow questions, I am still at a loss. EVERY method I have attempted to get a directory listing ends with Python sending two commands, TYPE A and PASV, then it just stops talking. Any…
user2725742
  • 398
  • 2
  • 12
2
votes
1 answer

Using TLS1.2 with ftplib in python 2.7.*

I need to connect to a ftp server which requires TLS 1.2 the ftplib has an object called FTP_TLS.ssl_version but I can't choose ssl.PROTOCOL_TLSv1_2 because its available only in Python 3.4 and will be available at python 2.7.9 which is not released…
W0bble
  • 757
  • 1
  • 8
  • 24
2
votes
1 answer

Transfer files from one FTP location to another using Python

I am trying to perform a task to transfer files between two different FTP locations. And the simple goal is that I would want to specific file type from FTP Location A to FTP Location B for only last few hours using Python script. I am using…
daaredevill
  • 31
  • 3
  • 8
2
votes
0 answers

Using ftplib to connect to secure ftp server ( EOF occurred in violation of protocol )

What i'm making wrong in this dead simple connect/list example? ( i'm using python 3.3 ) import ftplib ftp = ftplib.FTP_TLS() ftp.connect('localhost', 221, 20) ftp.login() ftp.prot_p() ftp.retrlines('LIST') Source :…
thclpr
  • 5,778
  • 10
  • 54
  • 87
2
votes
2 answers

Going through ftp directories in python

I'm trying to download several folders from an ftp server with Python 3 using ftplib. I have a list of the names of the folders. They are all located in a folder 'root'. The problem is that I don't know how to navigate through them. When I use cwdI…
wasmachien
  • 969
  • 1
  • 11
  • 28
2
votes
1 answer

Python FTP download 550 error

I've written an ftp crawler to download specific files. It works up until it finds the specific file it wants to download, and then it throws this error: ftplib.error_perm: 550 The file exists in my download folder, but the size of the file is 0…
MSJ
  • 154
  • 1
  • 3
  • 10
2
votes
0 answers

Slow uploads when using ftplib to upload multiple files at once

I'm trying to upload 30+ files via ftplib to a webserver but I'm having issues with uploading taking too long. If I use programs like CuteFTP, FTPPro or upload directly via the cpanel on my website it takes a few seconds to upload all 30+ files,…
Ryflex
  • 5,559
  • 25
  • 79
  • 148