Autor Beitrag
Hendi48
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mi 18.07.07 20:38 
Hi,
mein Programm soll per post ein passwort an eine seite senden (und eine datei zurückbekommen, das heißt nur wenn man das PW richtig eingibt bekommt man die datei) aber das klappt nicht ganz. Ich hab mal mit Wireshark gekuckt wie mein prog es macht und wie es eigentlich sein soll {im anhang}
Wie muss ich meinen code verändern das es so gemacht wird wie es sein soll? (btw. warum steht in Wireshark was von Multipart data-form das is doch gar nich in meinem prog)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure tform2.postcode(URL: string; Filename: String);
var
Data: TStringList;
files: TFileStream;
begin
files:= TFileStream.Create(Filename,fmcreate);
Data := TStringList.Create;   //Post-Daten-StringList erstellen
  try
    Data.Add('accesscode='+Edit1.Text);    //Post-Daten in die StringList eintragen
    idHttp1.Post(url,data,files);
  finally
    Files.free;
    Data.free;
  end;
end;

Aufruf:
ausblenden Delphi-Quelltext
1:
Postcode(label14.caption,'test.rar');   //label14 ist die url (die gibt es auch)					
Einloggen, um Attachments anzusehen!
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 18.07.07 21:32 
Kannst du mit IdHTTP.Request.ContentType umstellen.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Hendi48 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mi 18.07.07 23:11 
JUHU! Es downloadet endlich! :shock: Vielen dank für die Hilfe! :D