Hi
I think I found a small bug in the TIdAttachment::FileName
I have received a mail with an attachment that have a very stupid filename:
Fakturanr. 119180921 fra Lemvigh-Müller A/S.pdf
Indy only gives med the S.pdf part, the rest is discarded.
I know that the / isn't allowed in a filename on windows and it was ok if indy replaced it, but it should not discard everything in front of it.
I know the real filename because Thunderbird shows all of it, and when I want to save it replaces the / with -.
Can I do anything to get the full filename ??
Thanks in advance
Best regards
Asger
The code I use is this:
I think I found a small bug in the TIdAttachment::FileName
I have received a mail with an attachment that have a very stupid filename:
Fakturanr. 119180921 fra Lemvigh-Müller A/S.pdf
Indy only gives med the S.pdf part, the rest is discarded.
I know that the / isn't allowed in a filename on windows and it was ok if indy replaced it, but it should not discard everything in front of it.
I know the real filename because Thunderbird shows all of it, and when I want to save it replaces the / with -.
Can I do anything to get the full filename ??
Thanks in advance
Best regards
Asger
The code I use is this:
Code:
bool pdfMail::getPdfAttachments(TIdMessageParts *parts, TMailContent* MailContent )
{
parts->CountParts();
if( parts->AttachmentCount < 1 )return false;
int C = parts->Count;
for( int i = 0; i < C; ++i )
{
TIdAttachment *atcm = dynamic_cast<TIdAttachment*>( parts->Items[i] );
if( atcm && attachmentsIsPdf( atcm->FileName ) )// checks if the extension is pdf
{
MailContent->Attachments.Add( atcm );
}
}
return MailContent->Attachments.Count() > 0;
}