Registriert seit: 6. Apr 2005
10.109 Beiträge
|
Re: WinInet FTPPutFile() klappt net :x
9. Aug 2008, 15:58
Hallo,
WinInet wird es wissen:
Delphi-Quellcode:
const
S_AGENT = 'YouAreSkored';
function UploadToFtp(serverName, userid, password, fileName: string): LongBool;
var
hNet, hCon: HINTERNET;
begin
Result := False;
hNet := InternetOpen(S_AGENT, INTERNET_OPEN_TYPE_DIRECT, nil, nil, 0);
if Assigned(hNet) then
begin
hCon := InternetConnect(hNet, PChar(servername),
INTERNET_DEFAULT_FTP_PORT, PChar(userid), PChar(password),
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0
);
if Assigned(hCon) then
begin
Result := FtpPutFile(hNet, PChar(fileName),
PChar(ExtractFileName(fileName)), FTP_TRANSFER_TYPE_ASCII, 0
);
InternetCloseHandle(hCon);
end else ShowMessage(SysErrorMessage(GetLastError));
InternetCloseHandle(hNet);
end else ShowMessage(SysErrorMessage(GetLastError));
end;
Grüße vom marabu
|
|
Zitat
|