this is the code that comes along with the dll in a *.pas file, i guess it's what you'd call the source code:

Quote:

function HTTP_PostFile(id: gsfixed; URL,Filename, pVar: PA4_STRING): gsfixed;
const
LR : String[2] = #13#10;
var
Buf,Boundry,ContentTypePost,PostVar: String;
FileToSend : TMemoryStream;
Error: Integer;
function Inputtext(Name,Value: String): string;
begin
result := format(lr+'%s%sContent-Disposition: form-data; name="%s"%s%s%s%s'+#13#10,[boundry,lr,name,lr,lr,lowercase( value ),lr] );
end;
begin
Error := 0;
try
PostVar := StrPas(pVar^.chars);
THTTPCli(HTTPList[FIX2INT(id)]).SendStream := TMemoryStream.Create;

Boundry := '-----------------------------7cf29e12c04'; { Specified in Multipart/form-data RFC }
ContentTypePost := 'multipart/form-data; boundary=' + copy(Boundry,3,length(boundry));

Buf := Boundry + LR + 'Content-Disposition: form-data; name="uploadFile1"; filename="' + ExtractFileName(ExtractFilePath(ParamStr(0)) + StrPas(filename^.chars)) + '"'
+ LR + 'Content-Type: application/x-compress' + LR + LR;
//i don't think the IMAGE/PJPEG matters much
//my opinion on this would be that once it's set as this
//the file will be uploaded in BINARY

THTTPCli(HTTPList[FIX2INT(id)]).SendStream.Write(Buf[1], Length(Buf));

FileToSend := TMemoryStream.Create;
// Open File with TMemorystream
FileToSend.LoadFromFile(ExtractFilePath(ParamStr(0)) + StrPas(filename^.chars));
// load it up
FileToSend.SaveToStream(THTTPCli(HTTPList[FIX2INT(id)]).SendStream);
// Dump out file to TMemorystream
FileToSend.Free;
// andddd free it up
if PostVar<>'' then Buf := InputText('variable',PostVar);
Buf := ConCat(buf,Boundry+'--'); {This is to signify the END of our transactions }
THTTPCli(HTTPList[FIX2INT(id)]).SendStream.Write(Buf[1], Length(Buf));

TMemoryStream(ResultList[FIX2INT(id)]).Clear;
THTTPCli(HTTPList[FIX2INT(id)]).RcvdStream := TMemoryStream(ResultList[FIX2INT(id)]);
THTTPCli(HTTPList[FIX2INT(id)]).SendStream.Seek(0,0);
THTTPCli(HTTPList[FIX2INT(id)]).URL := StrPas(URL^.chars);
WorkList[FIX2INT(id)] := '1';
THTTPCli(HTTPList[FIX2INT(id)]).PostAsync;
except
Error := 1;
end;
result := INT2FIX(Error);
end;