Skip to main content
Table of Contents

TTMSFNCRESTClientRequest.AddFile Method

Adds a file part to a multipart request body and streams its content on execution.

API unit family: TMSFNCRESTClient Declaring type: TTMSFNCRESTClientRequest

Syntax

GeneratedPascalC++
procedure AddFile(const AName: string; const AFileName: TTMSFNCUtilsFile; const AContentType: string = 'application/octet-stream');
void __fastcall AddFile(const System::UnicodeString AName, const TTMSFNCUtilsFile &AFileName, const System::UnicodeString AContentType = L"application/octet-stream");

Remarks

Switches the request to multipart mode, sets Method to rmPOSTMULTIPART, sets CustomHeaders to True and assigns UploadFile. The file content itself is not stored in PostData; it is appended from the file when the request runs.

Parameters

Name Description
AName Name of the file form field.
AFileName File whose content is uploaded.
AContentType Content type of the file part.