Re: Open attachment

Giganews Newsgroups
Subject: Re: Open attachment
Posted by:  Remy Lebeau \(TeamB\) (
Date: Mon, 31 Mar 2008

"duf" <d…> wrote in message news:66AF022DEF4DE340d…

> 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: ( Attachment->StoredPathName.c_str() );

> I noticed that if I try to save again the same attachment in the same
> path,
> 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
for consistency.




In response to

Open attachment posted by duf on Fri, 28 Mar 2008