0 votes

Hi Support, I am sending email from mac machine which contains special characters but I am getting the different FileName & SafeFileName why is that ? please check the attachment for more information.

enter image description here

by

1 Answer

0 votes

This is precisely what IMail.SafeFileName is supposed to do.

Those characters are invalid on most systems - this is why they are replaced with underscore ('_').

Additionally backslash ('\') is treated as a folder separator.

You can always use IMail.FileName to get the original file name assigned by the sender. Do not blindly use it as you may overwrite some important files on your system if sender is malicious.

by (301k points)
now tell me 1 thing file name : CPK_052114_0510_a"_07.pdf and it dosen't contains backslash '\' so why it created the issue ?
'"' is not a legal path/filename character. Resulting name is "CPK_052114_0510_a__07.pdf" - double quote is changed to underscore.
...