Indy 9
|
TIdMultiPartFormDataStream = class(TStream)
TIdMultiPartFormDataStream is oriented towards handling HTTP messages specifically defined to carry HTML FORM data suitable for processing via the POST request method. TIdMultiPartFormDataStream includes support for uniformly representing both field and file upload requests, and a MIME compatible representation for field and file upload responses.
Multipart form content for the stream can include values for the HTML INPUT types:
TIdMultiPartFormDataStream utilizes the MIME media type "multipart/form-data" to specify the content-type for values in the HTTP message sent from a client to a server. Note: The content-type "multipart/mixed" may be used when multiple files are included the multipart response.
TIdMultiPartFormDataStream is used in the overloaded TIdHTTP.Post method when sending a "multipart/form-data" request to an HTTP server.
property Boundary: string;
property RequestContentType: string;
procedure AddFile(const AFieldName: string; const AFileName: string; const AContentType: string);
procedure AddFormField(const AFieldName: string; const AFieldValue: string);
procedure AddObject(const AFieldName: string; const AContentType: string; AFileData: TObject; const AFileName: string = '');
constructor Create;
destructor Destroy; override;
function Read(var Buffer; Count: Longint): Longint; override;
function Seek(Offset: Longint; Origin: Word): Longint; override; overload;
function Write(const Buffer; Count: Longint): Longint; override;