Skip to content

Instantly share code, notes, and snippets.

@dizzi
Created September 3, 2009 12:28
Show Gist options
  • Save dizzi/180271 to your computer and use it in GitHub Desktop.
Save dizzi/180271 to your computer and use it in GitHub Desktop.
import ftplib
import sys
import os
ftpServer = 'xxx'
ftpUser = 'xx'
ftpPass = 'xx'
#ftpPath = 'FileFlowStatus/'
ftpPath = '/'
def reportThis(filename, filecontent):
s = ftplib.FTP(ftpServer, ftpUser, ftpPass) # Connect
f = file(filename,'wb')
f.close()
f = file(filename,'rb')
s.storbinary('STOR '+ftpPath+filename, f) # Send the file
f.close() # Close file and FTP
os.remove(filename)
s.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment