From your code it looks like your FTP mode is binary, but you are uploading a ASCII file (html). Try changing your FTP mode to ASCII or zip your file first (which would be a binary file), send it and then unzip at your destination.
Here is and eaxmple from http://effbot.org/librarybook/ftplib.htm
import ftp
import os
def upload(ftp, file):
ext = os.path.splitext(file)[1]
if ext in (".txt", ".htm", ".html"):
ftp.storlines("STOR " + file, open(file))
else:
ftp.storbinary("STOR " + file, open(file, "rb"), 1024)
ftp = ftplib.FTP("ftp.fbi.gov")
ftp.login("mulder", "trustno1")
upload(ftp, "trixie.zip")
upload(ftp, "file.txt")
upload(ftp, "sightings.jpg")