Einzelnen Beitrag anzeigen

DaveRidge

Registriert seit: 14. Sep 2009
53 Beiträge
 
#15

Re: TIdMultipartFormDataStream; Bild via post übertragen

  Alt 6. Feb 2010, 20:34
Also ich hab mit Delphi2009 jetzt zwar die Postmethode hinbekommen, nur der Upload will noch nicht.
Der code:

Delphi-Quellcode:
var
// stream: TIdMultipartFormDataStream;
  Input:TStringList;
  Output:TStringStream;
begin
  Input := TStringList.Create;
//if not OpenDialog1.Execute then Exit;
//ProgressBar1.Min := 0;
// stream := TIdMultipartFormDataStream.Create;

  try
  Input.Values['user']:=Form1.Edit1.Text;
  Input.Values['passwort']:=Form1.Edit2.Text;
  Input.Values['Datei']:=; //Wie bekommw ich jetzt hier das Bild rein????
  Input.Values['mode1']:='p';
  Input.Values['mode2']:='1';
  Input.Values['mode3']:='f';
  Input.Values['schreiber']:='igge';
  Input.Values['usersbook']:='na du, wer sonst';
  Input.Values['text']:='MMh, maln Test';


// stream1.AddFile('$bild_2=',OpenDialog1.FileName,'jpg');
  Memo1.Text:=IdHTTP1.Post('http://www.blablabl.de/php.php',Input);
finally
  stream.Free;
   end;
end;
Ist zwar ein bissel durcheinander, weil ich noch nicht weiss wie ich das ausführen soll.
Kann mir da einer helfen?
  Mit Zitat antworten Zitat