ftpupload
-
ich würde gerne einen ftp upload aus einen programm starten.
folgenden code habe ich bereits versucht.void upload() { HINTERNET hOpen, hConnection; hOpen = InternetOpen("FTP Upload", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); hConnection = InternetConnect(hOpen, "127.0.0.1", INTERNET_DEFAULT_FTP_PORT,"Anonymous", "anonymous", INTERNET_SERVICE_FTP, 0, 0); FtpPutFile(hConnection, "C:\\localfile.exe", "\\remotefile.exe",FTP_TRANSFER_TYPE_BINARY, 0); InternetCloseHandle(hConnection); InternetCloseHandle(hOpen); }das ergebnis: einloggen klappt aber der upload will nicht
was mach ich da falsch?
-
"will nicht" ist keine ausreichende Fehlerbeschreibung. Werte erstmal GetLastError aus und dann sehen wir weiter.
-
meldung lautet "2"
und der ftp server meldet "The connection was closed by the remote socket"
-
// // MessageId: ERROR_FILE_NOT_FOUND // // MessageText: // // The system cannot find the file specified. // #define ERROR_FILE_NOT_FOUND 2LGibts die Datei "C:\\localfile.exe" auch? Bei mir funzt der Code so.
-
sorry war doch meldung "12003"
-
InternetGetLastResponseInfo
-
msdn schrieb:
ERROR_INTERNET_EXTENDED_ERROR
12003
An extended error was returned from the server. This is typically a string or buffer containing a verbose error message. Call InternetGetLastResponseInfo to retrieve the error text.