RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWebRequestFiles.Add Method (TWebRequestFile)

Adds a new Web request file object to the collection.

Pascal
procedure Add(const AName: string; const AFileName: string; const AContentType: string; AContent: Pointer; AContentLength: Integer); overload;
procedure Add(AFile: TWebRequestFile); overload;
C++
__fastcall Add(const AnsiString AName, const AnsiString AFileName, const AnsiString AContentType, void * AContent, int AContentLength);
__fastcall Add(TWebRequestFile AFile);

Call Add to add a TWebRequestFile object to the collection. Add inserts the new Web request file object at the end of the Items property array and increments the value of the Count property. 

Use the first syntax to cause TWebRequestFiles to create the Web request file object you are adding. Use the second syntax to add an existing TWebRequestFile object. Using either syntax, TWebRequestFiles assumes ownership of the new Web request file object and is responsible for freeing it. 

AName is the name of the adapter field whose value the new file represents. It becomes the value of the FieldName property of the new TWebRequestFile object. 

AFileName is the name of the file to add. It becomes the value of the FileName property of the new TWebRequestFile object. 

AContentType describes how the file content is encoded. It becomes the value of the ContentType property of the new TWebRequestFile object. 

AContent is an array of bytes that is the content of the file. It is used to initialize the Stream property of the new TWebRequestFile object. 

AContentLength is the number of bytes in AContent. 

AFile is an existing TWebRequestFile object that describes the file you are adding. 

 

Count 

Items 

FieldName 

FileName 

ContentType 

Stream

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!