Mar-05-2017, 12:28 PM
I guess i made a silly mistake. In case someone else encounters the same, i had to add myfile.seek(rest_pos,0)
in Client code # 2 to start reading the file at the specific position. So it should look like this:
in Client code # 2 to start reading the file at the specific position. So it should look like this:
import ftplib ftp = ftplib.FTP() ftp.connect("localhost",8080) ftp.login("test","123") block_size = 128 c_dir = "C:\\Users\\Usr\\Desktop\\client_data" filename = "test.pdf" # ~ 30Mb ftp.dir() myfile = open(c_dir + "\\" + filename , "rb") ftp.voidcmd('TYPE I') rest_pos = ftp.size(filename) print(rest_pos) myfile.seek(rest_pos,0) ftp.storbinary("STOR " + filename, myfile, blocksize=block_size, rest=rest_pos) ftp.dir() ftp.close()storbinary() takes care of the conversion of rest_pos from int to str