Topic Path: Symbol Reference > Classes > TIdAttachmentFile Class > TIdAttachmentFile Methods > SaveToFile Method
ContentsIndexHome
PreviousUpNext
TIdAttachmentFile.SaveToFile Method

Copies the content for a file-based message attachment to the specified file name.

procedure SaveToFile(
    const FileName: String
); override;
Parameters 
Description 
FileName 
FIle used to store the contents of the file-based attachment. 

SaveToFile is an overridden method used to copy the contents of the file-based message attachment to the file name specified in the FileName argument. 

SaveToFile calls the CopyFileTo function to copy the contents of the file specified in StoredPathname to the file indicated in the FileName argument. 

SaveToFile can raise an EIdException if the file copy cannot be performed using StoredPathName or the FileName argument. 

Use OpenLoadStream to access the content for a file-based attachment creasted using SaveToFile.

Exceptions 
Description 
Raised with the message RSTIdMessageErrorSavingAttachment when StorePathName or the file name argument cannot be used to read or write the attachment content. 
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.