function UploadFolder(lpszServer, lpszUsername, lpszPassword, lpszLocalDirectory, lpszRemoteDirectory:
String; wPort: Word = 21): Boolean;
var
hOpen, hConnect: HINTERNET;
begin
Result := False;
hOpen := InternetOpen('
MyAgent', INTERNET_OPEN_TYPE_DIRECT,
nil,
nil, 0);
if (hOpen <>
nil)
then
begin
hConnect := InternetConnect(hOpen, PChar(lpszServer), wPort, PChar(lpszUsername), PChar(lpszPassword),
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
Result := FtpPutFile(hconnect, pchar(lpszLocalDirectory),
pchar('
/html/small/test.jpg'),
//<-- test.jpg soll in den Ordner small, klappt aber nicht!
FTP_TRANSFER_TYPE_UNKNOWN, 0);
InternetCloseHandle(hConnect);
InternetCloseHandle(hOpen);
end
end;