Vous n’êtes pas connecté.
Bonjour, visiteur, bienvenue sur les forums Aqua Computer Forum. Si c’est votre première visite, nous vous invitons à consulter l’Aide. Elle vous expliquera le fonctionnement de cette page. Pour avoir accès à toutes les fonctionnalités, vous devez vous inscrire. Pour cela, veuillez utiliser le formulaire d’enregistrement, ou bien lisez plus d’informations sur la procédure d’enregistrement. Si vous êtes déjà enregistré, veuillez vous connecter.
![]() |
Code source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import ftplib import os.path import time FILENAME = 'test.zip' FTP_HOST = 'example.com' FTP_USER = 'username' FTP_PASSWD = 'password' def upload_file(): """Datei hochladen.""" conn = ftplib.FTP(FTP_HOST, FTP_USER, FTP_PASSWD) conn.storbinary('STOR %s' % FILENAME, FILENAME) conn.quit() if __name__ == '__main__': while True: if os.path.exists(FILENAME): ______upload_file() time.sleep(10) |
Citation de "Y0Gi"
Pah, das kann man ja auch wohl mal eben selbst programmieren!![]()
![]() |
Code source |
1 |
conn.storebinary('STOR %s' % FILENAME, FILENAME) |
![]() |
Code source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import ftplib import os.path import time FILENAME = 'test.zip' FTP_HOST = '***.de' FTP_USER = '***' FTP_PASSWD = '****' def upload_file(): """Datei hochladen.""" conn = ftplib.FTP(FTP_HOST, FTP_USER, FTP_PASSWD) conn.cwd('public_html\ftp') conn.storebinary('STOR %s' % FILENAME, FILENAME) conn.quit() if __name__ == '__main__': while True: if os.path.exists(FILENAME): upload_file() time.sleep(10) |
![]() |
Code source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import ftplib import os.path import time FILENAME = 'test.zip' FTP_HOST = '***.de' FTP_USER = '****' FTP_PASSWD = '****' def upload_file(): """Datei hochladen.""" conn = ftplib.FTP(FTP_HOST, FTP_USER, FTP_PASSWD) conn.cwd('//public_html/ftp/') conn.storbinary('STOR %s' % FILENAME, FILENAME) conn.quit() if __name__ == '__main__': while True: if os.path.exists(FILENAME): upload_file() time.sleep(10) |
![]() |
Code source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import ftplib import os.path import os import time FILENAME = 'test.zip' FTP_HOST = 'ftp-server.de' FTP_USER = '*****' FTP_PASSWD = '*****' def upload_file(): """Datei hochladen.""" conn = ftplib.FTP(FTP_HOST, FTP_USER, FTP_PASSWD) conn.cwd('/public_html/ftp/') conn.storbinary('STOR '+ FILENAME, open(FILENAME, "rb"), 1024) # wenn man will, dass die Datei nach dem hochladen auch geloescht wird # in der naechsten Zeile die fuehrende Raute entfernen #os.remove(FILENAME) conn.quit() if __name__ == '__main__': while True: if os.path.exists(FILENAME): upload_file() time.sleep(10) |
Citation de "hobbes_dmS"
jaja, Y0Gi, mit dem blind coden ist es immer so 'ne Sache![]()
-