Annulleret

WinSock POST Function

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:=[url removed, login to view];

IdHTTP1:=[url removed, login to view](Form1);

try

[url removed, login to view]([url removed, login to view](Data));

[url removed, login to view]:='image/gif';

Result:=[url removed, login to view]('http://'+Server+Path,outdata);

except

end;

[url removed, login to view];

[url removed, login to view];

if(Result<>'')then try

Result:=[url removed, login to view](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њEЊЛ'#$A'В@'#$C#0'яfЏ'#5'ҐKл!џа'#3'ZиQ¶6” I$Йцы­^ј'#$C'Г'#$1C'fCѓ>§â€”®$P'#$16'&9$.'#$F'SGїohN*pLГyјMjO’'#$15'F«ш'#$B'WщыЂ'#$12'—КуѕЛiЦ '#5'Ъ®=u}ЮзЕГ9ЮрEгaXё±ъ'#1#$98#4'+¤'

I receive on server all befoure #0 -

'xњEЊЛ'#$A'В@'#$C

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

Færdigheder: Delphi

Se mere: winsock post, winsock post data, zcompressstr example, post winsock, zcompressstr, idhttp1 post example, string b, post your, n. y. post, free 1099, compress string, send compressed tidhttp, zdecompressstr, idhttp1 post, delphi post winsock, delphi winsock post, delphi winsock http post, delphi idhttp1 char, idhttp1post image, winsock post delphi, idhttp character, delphi tidhttp, idhttp1 post chracter problem, idhttp image post, post http winsock

Om arbejdsgiveren:
( 4 bedømmelser ) Moscow, Russian Federation

Projekt-ID: #255323

2 freelancers are bidding on average $30 for this job

jlbnet

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

$30 USD in 3 dage
(0 bedømmelser)
0.0
dinilud

i think this will work for you. [url removed, login to view](HTMLEncode([url removed, login to view](Data)));

$30 USD in 0 dage
(0 bedømmelser)
0.0