Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug in TIdAttachment::FileName ?
#1
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:

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;
}
Reply


Messages In This Thread
Bug in TIdAttachment::FileName ? - by Asger-P - 08-27-2020, 05:06 PM
RE: Bug in TIdAttachment::FileName ? - by rlebeau - 08-28-2020, 12:47 AM
RE: Bug in TIdAttachment::FileName ? - by Asger-P - 08-28-2020, 10:44 AM
RE: Bug in TIdAttachment::FileName ? - by rlebeau - 08-28-2020, 10:27 PM
RE: Bug in TIdAttachment::FileName ? - by Asger-P - 08-29-2020, 05:46 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)