Sie sind nicht angemeldet.
Lieber Besucher, herzlich willkommen bei: Aqua Computer Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
Quellcode |
|
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) |
Zitat von »Y0Gi«
Pah, das kann man ja auch wohl mal eben selbst programmieren!
Quellcode |
|
1 |
conn.storebinary('STOR %s' % FILENAME, FILENAME) |
Quellcode |
|
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) |
Quellcode |
|
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) |
Quellcode |
|
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) |
Zitat von »hobbes_dmS«
jaja, Y0Gi, mit dem blind coden ist es immer so 'ne Sache
-