Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This is a core of techcore(yes a core of a core xD) and contains ftp utilities
- #Requires Tehchcore V.1.2.0
- from ftplib import FTP
- import os
- def uploadFile(ftp , file , remotePath) :
- ftp.cwd(remotePath)
- ftp.storlines("STOR " + file.name.split("\\")[-1] , file)
- def downloadFile(ftp , file , remotePath , bitrate) :
- directory = os.path.dirname(remotePath)
- filename = os.path.basename(remotePath)
- ftp.cwd(directory)
- #print(filename , directory , type(file) , bitrate)
- ftp.retrbinary("RETR " + filename , file.write , bitrate)
- def deleteFile(ftp , path) :
- directory = os.path.dirname(path)
- filename = os.path.basename(path)
- ftp.cwd(directory)
- ftp.delete(filename)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement