Project Detail

WinSock POST Function  

WinSock POST Function is project number 255323
posted at GetAFreelancer.com. Click here to post your own project.

 

Bookmark and Share
Free Trial For New Buyers
 

Status: Closed
(Cancelled by Service Buyer)

Selected Providers: -

Budget: $30-250

Created: 04/28/2008 at 5:37 EDT

Bid Count: 2

Average Bid: $ 30

04/30/2008 at 5:37 EDT

Project Creator: dcarnage View PM Post PM
Employer Rating: 10.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/10 (2 reviews)

Bid On This Project
 

Description

Hello, I have a bug in our winsock POST function.
If you fix it I shall transfer $15 to your account.

I have function

function LoadPage(Server,Path,Data:string;Compress: Boolean):widestring;
var
IdHTTP1: TIdHTTP;
outdata: TStringList;
Label ReTry;
begin
Result:='';
outdata:=TStringList.Create;
IdHTTP1:=TIdHTTP.Create(Form1);
try
outdata.Add(Zlibex.ZCompressStr(Data));
IdHTTP1.Request.ContentType:='image/gif';
Result:=IdHTTP1.Post('http://'+Server+Path,outdata);
except
end;
outdata.Free;
idHTTP1.Free;
if(Result<>'')then try
Result:=ZLibex.ZDecompressStr(Result);
except end;
end;



It Should Send Packet like

Content-type: image/gif
Content-length: 71

RAW_BINARY_DATA_HERE

All is ok except one bug:
When I have #0 character in Compressed string I have result on server truncated.
For example if I have Compressed String
'x&#1114;E&#1034;&#1051;'#$A'&#1042;@'#$C#0'&#1103;f&#1039;'#5'&#1168;K&#1083;!&#1119;&#1072;'#3'Z&#1080;Q¶6” I$&#1049;&#1094;&#1099;­^&#1112;'#$C'&#1043;'#$1C'fC&#1107;>§—®$P'#$16'&9$.'#$F'SG&#1111;ohN*pL&#1043;y&#1112;MjO’'#$15'F«&#1096;'#$B'W&#1097;&#1099;&#1026;'#$12'—&#1050;&#1091;&#1109;&#1051;i&#1062; '#5'&#1066;®=u}&#1070;&#1079;&#1045;&#1043;9&#1070;&#1088;E&#1075;aX&#1105;±&#1098;'#1#$98#4'+¤'

I receive on server all befoure #0 -
'x&#1114;E&#1034;&#1051;'#$A'&#1042;@'#$C

How does such binary data like images etc should be transferred, should it be escaped or something ?

Messages Posted: 0 View project clarification board Post message on project clarification board

Bid On This Project
 
If you are the project creator or one of the bidders Log In for more options

  View PM Post PM

30

3 days

04-28-2008 06:36 EDT

should not use string, instead of pchar, or simply an array of byte should work.

help

  View PM Post PM

30

0 days

04-28-2008 09:48 EDT

(No Feedback Yet)

i think this will work for you. outdata.Add(HTMLEncode(Zlibex.ZCompressStr(Data)));

help

    Bid on this Project