Einzelnen Beitrag anzeigen

HolgerX

Registriert seit: 10. Apr 2006
Ort: Leverkusen
961 Beiträge
 
Delphi 6 Professional
 
#5

AW: Per indy mehre Datein als Multipart über https versenden.

  Alt 19. Feb 2018, 17:44
Hmm..

Schau mal hier:

https://stackoverflow.com/questions/...e-with-tidhttp

Zitat:
I found the problem. It was about the boundary that I must to set. So the final result is:

Delphi-Quellcode:

DS := TIdMultiPartFormDataStream.Create;
DS.AddFile('fileUpload2', 'C:\Users\r.rezino\Desktop\teste.po', 'application/octet-stream');
try
    FHttpComunication.Request.ContentType := 'multipart/form-data; boundary=' + DS.Boundary;
    FHttpComunication.Request.AcceptEncoding := '';
    FHttpComunication.Request.Accept := '';
    FHttpComunication.Request.Host := '';
    FHttpComunication.Request.UserAgent := '';

    FHttpComunication.Put(UrlCmd, DS, Response);
finally
    DS.Free;
    Response.Free;
end;
Wenn ich das richtig verstanden habe, wird beim POST automatisch das richtige ContentType und boundary gesetzt.
Jedoch bei PUT musst Du das selber machen..
  Mit Zitat antworten Zitat