Open attachment

Giganews Newsgroups
Subject: Open attachment
Posted by:  duf (d…@wp.pl)
Date: Fri, 28 Mar 2008

Do I have to write on disk the attachment to open it in the same time ?

string dane;
fstream odczyt;

Attachment->SaveToFile( "D:\Temp\" + Attachment->FileName );

odczyt.open ( "D:\Temp\" + Attachment->FileName );
while( getline( odczyt, dane, '
' ));

odczyt.close();

I tried to send attachment to stringstream but there is only a name of attachment.

I noticed that if I try to save again the same attachment in the same path, program throw exception. Why ?
I thought that previous file will be overwritten.

Replies