filestorage OnExtract event
Example
Return to Introduction  Previous page  Next page
Applies to
acFileStorage component.  

Declaration
procedure OnExtract(Sender: TObject; FileName: String; FileSize: Integer; var AllowExtracting: Boolean);  

Description
The OnExtract event occurs when StoredFile is ready to be extracted.  
 
Write an OnExtract event handler to determinate whether this file could be extracted. Set AllowExtracting parameter to False to pervent file from extracting.  

Parameters
FileNamefile name of the file to extract.  
FileSizesize (in bytes) of the file to extract.  
AllowExtractingdetermines whether the file (specified by FileName parameter) could be extracted.  

Example
procedure TForm1.FileStorageExtract(Sender: TObject;  
   FileName: String; FileSize: Integer;   
   var AllowExtracting: Boolean);  
begin  
  if UpperCase(ExtractFileExt(FileName)) = '.TXT' then  
    AllowExtracting := False;  
end;