Closed danielkuettner closed 1 year ago
There are 1 mistake in my PR:
coReadData = coInFile (instead of coFile)
and in row 904 StrLCopy should be replaced with
MoveFast((Upload.buf + Upload.uploaded)^, buffer^, Result);
Thanks and sorry for the mistake, Daniel
Could you please update your PR ?
example for uploading file:
function FTPUploadFile(const pmcUrl, pmcUserName, pmcPassword: RawUtf8; const pmvContent: RawByteString): TCurlResult; var hnd: TCurl; Upload: TTransfer; begin Result := crFailedInit; if not CurlIsAvailable then Exit; //=>
hnd := curl.easy_init; if hnd <> Nil then begin Upload.buf:= PAnsiChar(pmvContent); Upload.size:= Length(pmvContent); Upload.uploaded:= 0;
end; end;
... url:= cUrl + filename; buffer:= StringFromFile('SOneSrv2.log'); if FTPUploadFile(url, u, p, buffer) = crOk then doSomething;