You are not logged in.
Pages: 1
I found examples on forum and I build service with upload file:
procedure TFileDownloadUploadRest.Upload(Ctxt: TSQLRestServerURIContext);
var
aFileName: string;
aFilePath: string;
begin
case Ctxt.Method of
mPOST,mPUT:
begin
aFileName := 'R:\test.bin';
FileFromString(Ctxt.Call.InBody, aFileName);
Ctxt.Success;
end;
end;
but in saved file (at beginning file) I get unnecessary data:
-----------------------------7e12762010838
Content-Disposition: form-data; name="fileToUpload"; filename="C:\Users\Jacek\Downloads\file.bin"
Content-Type: application/octet-stream
MZP ˙˙ ¸ @ ş ´ Í!¸LÍ!This program must be run under Win32
$7
In fact, the beginning of the file is from the bytes MZP...
How get real data of file, without header data?
Offline
Take a look at TSQLRestServerURIContext.InputAsMultiPart.
Online
Thanks!
Offline
Pages: 1