[Tutor] FTP Upload

John Weller john at johnweller.co.uk
Tue Jul 14 14:15:16 EDT 2020


Hi

I have some graphs created with matplotlib which I need to upload to a web server.  I am using the command:

filename = 'mygraph.png'
ftp.storbinary("STOR " + filename, open(filename, "rb"))

When I try to look at the graphs on the website they don't display and if I then download them to my PC using FileZilla and try to open them they are corrupt and show as Invalid Image.  If however I upload them manually using FileZilla they display correctly on the website.  I am obviously doing something wrong 😊  Advice please.

TIA

John

John Weller
01380 723235
07976 393631




More information about the Tutor mailing list