Einzelnen Beitrag anzeigen

Sascha999999999

Registriert seit: 28. Sep 2006
45 Beiträge
 
#3

Re: TIdMultiPartFormDataStream und AddFile

  Alt 28. Sep 2006, 22:33
habe ein änliches Problem!!!

addFile wird von PHP Script das mit:

<?
print_r($_REQUEST);
print_r($_FILE);
?>

nur user und Hash erkennt. aber nicht File:

HTTP Sniffer:
Delphi-Quellcode:
POST /user/klasse/online/AI601/CMS/upload/cms/upload.php?user=Sascha&hash= HTTP/1.0
Connection: keep-alive
Content-Type: multipart/form-data; boundary=--------092806231824670
Content-Length: 558
Host: sascha-net.homeip.net
Accept: text/html, */*
Accept-Encoding: deflate, gzip, identity
User-Agent: AIcms

----------092806231824670
Content-Disposition: form-data; name="user"

Sascha
----------092806231824670
Content-Disposition: form-data; name="hash"


----------092806231824670
Content-Disposition: form-data; name="file"; filename="C:\WINDOWS\DESKTOP\WEB-FTP\FILE_UPLOAD\6\temp\31884.cab"
Content-Type: application/x-cab-compressed



MSCF....³.......,...................E.......e.........15²ž`.Head.txt.8Cæêf.e.CKó.      Ð7Ô3T020Pð÷æårI,IµR..ÍÓQ04W.N-.ɘ).ZZ™šX..(¸û†ðr9ç畤æ•è–T...—¤V”èg”äæX+$g$..§–Øf.çëZX˜Zê.òrñr..
----------092806231824670--
HTTP/1.1 200 OK
Date: Thu, 28 Sep 2006 21:18:19 GMT
PICS-Label: (PICS-1.0 "http://www.rsac.org/ratingsv01.html" l on "2005.06.04T16:02+0200" exp "2006.06.04T12:00+0200" r (v 0 s 0 n 0 l 0))
X-Powered-By: ASP.NET
MicrosoftOfficeWebServer: 5.0_Pub
Content-type: text/html; charset=iso-8859-1

Array
(
    [user] => Sascha
    [hash] =>
)
Der delphi Code:
Delphi-Quellcode:
ResponseInfo:=TIdMultiPartFormDataStream.Create;
ResponseInfo.AddFormField('user', ini.ReadString('Benutzerdaten', 'Username', ''));
ResponseInfo.AddFormField('hash', encode64(ini.ReadString('Benutzerdaten', 'PasswdHash', '')));
ResponseInfo.AddFile( 'file', achiv, 'application/x-cab-compressed' );
IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
idHTTP1.POST('http://sascha-net.homeip.net/user/klasse/online/AI601/CMS/upload/cms/upload.php?user='+ini.ReadString('Benutzerdaten', 'Username', '')+'&hash='+code(ini.ReadString('Benutzerdaten', 'PasswdHash', '')), ResponseInfo);
idHTTP1.Free;
kann mir jemand helfen?

meine IdMultipartFormData.pas ist im Anhang, eventuel liegt da ja der Fehler...
Angehängte Dateien
Dateityp: pas idmultipartformdata_115.pas (17,0 KB, 63x aufgerufen)
  Mit Zitat antworten Zitat