[Tutor] FTP Upload

Harold Doran harold.doran at cambiumassessment.com
Tue Jul 14 14:23:28 EDT 2020


Consider serializing and sending as json. See examples here:

https://matplotlib.org/3.1.1/devel/MEP/MEP25.html#examples

-----Original Message-----
From: Tutor <tutor-bounces+hdoran=air.org at python.org> On Behalf Of John Weller
Sent: Tuesday, July 14, 2020 2:15 PM
To: tutor at python.org
Subject: [Tutor] FTP Upload

External email alert: Be wary of links & attachments.


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


_______________________________________________
Tutor maillist  -  Tutor at python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list