http OutputFileName property
Return to Introduction  Previous page  Next page
Applies to
auHTTP component.  

property OutputFileName: String;  

The OutputFileName property specifies the target filename for downloaded resource. If the OutputFileName specified, the auHTTP uses the TFileStream instead of TMemoryStream as the storage for downloaded data.  
tip Use the OutputFileName to specify the target filename if you need save data to the file AND if you don't want to use memory-stream of OnDone event.  
If you would like to hide the temporary (incomplete) file while it downloading — set OutputFileAttributes.Incomplete property to [atrHidden].  
In case if the OutputFileName can not be created (e.g. path not exists, or file locked by system etc) — OnOutputFileError event occur.  

iiwarning The downloaded document will not be stored to the "OutputFileName", in case if component received erroneous status response code (not 200 - OK and not 206 - Partial Content (if request was initiated by Resume or ReadRange methods)).  
In case of HTTP error, the downloaded content will be represented as TMemoryStream in various events of auHTTP.  

auHTTP1.URL := '';  
auHTTP1.OutputFileName := 'c:\';  

See also
OutputFileAttributes property;  
Read, ReadRange and Resume methods;  
OnDone, OnHTTPError and OnOutputFileError events;  
HTTP Status Codes.