|Subject:||Re: Open attachment|
|Posted by:||Remy Lebeau \(TeamB\) (firstname.lastname@example.org)|
|Date:||Mon, 31 Mar 2008|
"duf" <d…@wp.pl> wrote in message news:66AF022DEF4DE340d…@wp.pl...
> Do I have to write on disk the attachment to open it in the same time ?
Indy saves a decoded attachment to a disk file by default. The SaveToFile()
method merely copies that file from one folder to another. If you want to
open the original file without copying it first, use the
TIdAttachmentFile::StoredPathName property, ie:
odczyt.open ( Attachment->StoredPathName.c_str() );
> I noticed that if I try to save again the same attachment in the same
> program throw exception. Why ?
Under Win32, SaveToFile() is coded to fail if the file already exists. In
..NET and Linux, it will overwrite the file instead. This should be changed
Open attachment posted by duf on Fri, 28 Mar 2008