Trochu som to upravil, teraz to vyzera takto:
Kód:
req = "POST /!pages/upload.php HTTP/1.1\r\n";
req += "Host: www.austyn.sk\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6\r\n";
req += "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n";
req += "Accept-Language: sk,cs;q=0.8,en-us;q=0.5,en;q=0.3\r\n";
req += "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n";
req += "Keep-Alive: 300\r\n";
req += "Connection: keep-alive\r\n";
req += "Referer: http://www.upnito.sk/\r\n";
req += "Content-Type: multipart/form-data; boundary=gGg\r\n";
req += "Content-Length: 500\r\n";
req += "--gGg\r\n";
req += "Content-Disposition: form-data; name=\"subor\"; filename=\"msvcp80.txt\"\r\n";
req += "Content-Type: text/plain\r\n\n";
req += "abcdef\r\n";
req += "--gGg--\r\n\r\n";
Odpoved:
Kód:
<p>Your browser sent a request that this server could not understand.<br />
Request header field is missing ':' separator.<br />
<pre>
--gGg</pre>
</p>
Z coho vyplyva, ze mu vadi ten zaciatocny boundary.. To ale nechapem, lebo ked si to pozriem v FireFoxe cez ten doplnok tak ten zaciatocny boundary tam je... Retazec gGg neni obsiahnuty nikde (vlastne vsak to aj vidis, zatial tam neposielam obsah suboru ale len konstantny text..