Using Python to upload large files to FTP

6897
4
Jump to solution
06-13-2019 12:29 PM
AustinWolf
Emerging Contributor

Hey guys, I wrote a script so I can post a large zipped dataset up to an FTP site, but I keep getting this return:

Traceback (most recent call last):
   File "C:/Users/wolf_ak/Desktop/Python/FTP Upload.py", line 17, in <module>
      ftp.storlines('STOR ' +filename,myfile)
   File "C:\Python27\ArcGIS10.5\lib\ftplib.py", line 497, in storlines
     raise Error("got more than %d bytes" % self.maxline)
Error: got more than 8192 bytes

Is there a workaround to this?  The file I'm trying to post will be north of 70,000 KB

Here is my code:

I appreciate any and all help. 

Thank you!

1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi Austin,

Instead of ftp.storlines try ftp.storbinary.

View solution in original post

4 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Austin,

Instead of ftp.storlines try ftp.storbinary.

AustinWolf
Emerging Contributor

Thanks! I'll give it a shot. Everything inside of the parentheses should stay the same? 

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Yes, everything in the parentheses should stay the same.

0 Kudos
AustinWolf
Emerging Contributor

That was it! You're a lifesaver!! Thanks Jake

0 Kudos