filestorage Extract method
Example
Return to Introduction  Previous page  Next page
Applies to
acFileStorage component.  

Declaration
function Extract(const FileName: String; OutputFile: String = ''): Boolean; overload;  
function Extract(FileIndex: Integer; OutputFile: String = ''): Boolean; overload;  

Description
The Extract method is destined to extract stored files from acFileStorage component to disk.  
 
ParametersMeanings  
FileNamespecifies the exact (though case sensitive) file name of stored file.  
FileIndexthis is alternative to FileName parameter in overloaded version of Extract method. Specifies the index of file in Files list.  
OutputFilespecifies the location (directory) and the file name of output file. If not specified, the FileStorage will extract file to path specified in AutoExtract.ExtractTo.SubDirectory property.  
 
Returns True if file has been successfully extracted.  

Example 1
procedure TForm1.ExtractBtnClick(Sender: TObject);  
begin  
  acFileStorage1.Extract('MyFile.exe''c:\MyFolder\MyFile.exe');  
end;  

Example 2
procedure TOptionsForm.DefaultsBtnClick(Sender: TObject);  
begin  
  MainForm.acFileStorage1.Extract(0); // extracts first file in Files list to current folder  
end;  

See also
AutoExtract structure and Files property.