A
A
Andrew2020-06-19 13:36:54
Python
Andrew, 2020-06-19 13:36:54

How to change the default "weight" for the transferred ftplib file?

There is such a code, but by default the "weight" of the transferred file is only 8192 bytes, how can I change the default setting to be able to transfer larger files?

The code
import ftplib

filename= "*****.xlsx"

ftp= ftplib.FTP('*********')

ftp.login('*******', '********')

ftp.cwd('*******')

uploadfile= open('(**/***************/*******', 'rb')

ftp.storlines('STOR ' + filename, uploadfile)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim, 2020-06-19
@NearYou

And if you first request the file size from the ftp server
ftp.size('ftp_dir/filename.zip')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question