I have to send files to a php script with delphi. I finaly chose to use Wininet functions because I have to pass through a NTLM Authentication proxy.
When i send the file, I have empty chars (00) between each chars of my content request :
POST /upload.php HTTP/1.1
User-Agent: MYUSERAGENT
Host: 127.0.0.1
Cookie: ELSSESSID=k6ood2su2fbgrh805vs74fvmk5
Pragma: no-cache
Content-Length: 5
T.E.S
Here is my Delphi code :
pSession := InternetOpen('MYUSERAGENT', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
pConnection := InternetConnect(pSession, PChar('127.0.0.1'), INTERNET_DEFAULT_HTTP_PORT, nil, nil, INTERNET_SERVICE_HTTP, 0, 0);
pRequest := HTTPOpenRequest(pConnection, PChar('POST'), PChar('/upload.php'), 'HTTP/1.0', nil, nil, INTERNET_SERVICE_HTTP, 0);
HTTPSendRequest(pRequest, nil, 0, Pchar('TESTR'), Length('TESTR'));
Any ideas of what's happening?