Community Discussions and Support
Attachment file type not recognized - file name too long?

I received a PDF attachment with a very long name. The attachment viewer marked it as an unknown file type. It appears the name is too long and the .PDF extension is cut off. Is there a size limit on the number of characters in an attachment name?


I received a PDF attachment with a very long name. The attachment viewer marked it as an unknown file type. It appears the name is too long and the .PDF extension is cut off. Is there a size limit on the number of characters in an attachment name?

There are two parts to your question.
First is the filename length. AFAIK, there is no limit other than the filename length that will fit in the column. Those column widths can be adjusted allowing you to make the File Name column very wide. I tested a pdf attachment with a 50 character filename and it displayed with lots of room to spare. How many characters was the filename of the attachment you received?


Second is the unknown file type. This is a known problem that is associated with the content type defined by the sender. When defined as "Content-type: application/pdf", Pegasus Mail knows that it is a pdf file but it is becoming common for the content type to be defined as "Content-type: application/octet-stream" which is a generic type used for many different file types. In those cases, Pegasus Mail can't tell that it is a pdf file.


There are two parts to your question. First is the filename length. AFAIK, there is no limit other than the filename length that will fit in the column. Those column widths can be adjusted allowing you to make the File Name column very wide. I tested a pdf attachment with a 50 character filename and it displayed with lots of room to spare. How many characters was the filename of the attachment you received? Second is the unknown file type. This is a known problem that is associated with the content type defined by the sender. When defined as "Content-type: application/pdf", Pegasus Mail knows that it is a pdf file but it is becoming common for the content type to be defined as "Content-type: application/octet-stream" which is a generic type used for many different file types. In those cases, Pegasus Mail can't tell that it is a pdf file.

I expanded the attachment column for file name as wide as it would go. If I counted correctly, 133 characters of the filename were shown. It ended with a left parenthesis. There were about 31 more characters cut off including the ".pdf" file type. I know this because I had the sender resend the document and I went directly to my Gmail account on google.com and could see the full filename. I know this is an extremely long name and I'm not sure why it was named the way it was but it may be longer than Pegasus can handle.


I expanded the attachment column for file name as wide as it would go. If I counted correctly, 133 characters of the filename were shown. It ended with a left parenthesis. There were about 31 more characters cut off including the ".pdf" file type. I know this because I had the sender resend the document and I went directly to my Gmail account on google.com and could see the full filename. I know this is an extremely long name and I'm not sure why it was named the way it was but it may be longer than Pegasus can handle.

Would be careful on attachments. With Windows, a file might have a PDF extention, but could actually be some other type of executible, and windows might try to run it. Have seen files with various extentions that turn out to exe or dll files that when passed to windows will try to execute.


Real PDF files should actually start with a %PDF.
First one looks at extention, 2nd one looks for PDF starting at byte 1
PDF-file,0,X,0,.pdf
PDF-FILE,0,S,1,PDF,X,0,.PDF


Might be too long file name. I generally, would save file and look at it with hex editor to see what it starts with.
%PDF would be a PDF, but if it starts with MZ it is an executible...


What program to you have set to use for PDF files. Windows default or a different PDF viewer.


Would be careful on attachments. With Windows, a file might have a PDF extention, but could actually be some other type of executible, and windows might try to run it. Have seen files with various extentions that turn out to exe or dll files that when passed to windows will try to execute. Real PDF files should actually start with a %PDF. First one looks at extention, 2nd one looks for PDF starting at byte 1 PDF-file,0,X,0,.pdf PDF-FILE,0,S,1,PDF,X,0,.PDF Might be too long file name. I generally, would save file and look at it with hex editor to see what it starts with. %PDF would be a PDF, but if it starts with MZ it is an executible... What program to you have set to use for PDF files. Windows default or a different PDF viewer.

mikes@guam.net

This was a PDF file from a trusted user. I was able to open it with Adobe Reader directly from Google Gmail. Pegasus doesn't recognize it because it can't see the whole filename (about 160 characters) and .PDF extension.


This was a PDF file from a trusted user. I was able to open it with Adobe Reader directly from Google Gmail. Pegasus doesn't recognize it because it can't see the whole filename (about 160 characters) and .PDF extension.

Pegasus doesn't recognize it because it can't see the whole filename (about 160 characters) and .PDF extension.


I remain curious about how the content type was defined in the message. You can see that in the raw view. A search for "Content-type: application" should find it. They may be multiple entries. The one preceding the attachment content should be readily identifiable.


[quote="pid:56494, uid:26261"]Pegasus doesn't recognize it because it can't see the whole filename (about 160 characters) and .PDF extension.[/quote] I remain curious about how the content type was defined in the message. You can see that in the raw view. A search for "Content-type: application" should find it. They may be multiple entries. The one preceding the attachment content should be readily identifiable.
edited Mar 15 at 5:16 pm

Uploaded a screen shot of how the attachment appears in the Pegasus attachment window. Had to upload it 'cause I couldn't get it to copy here. The Description column is as wide as possible yet the name is cut off at "... Install Six (".


I also found the Content Type in the Raw View and included that in screen shot document. I'll summarize it here.


The attachment type in the Raw View appears as:
Content-Type: application/pdf;
The attachment name in the Raw view is complete with ".pdf" as the file type:
name="Proposal - Sunland Village East HOA - Fill Cracks and Voids - Coat and Stripe Six (6) Tennis Courts - Provide and Install Six (6) Tennis Nets - 03092024.pdf"


It's a crazy long name, but it appears to be formatted correctly.


Uploaded a screen shot of how the attachment appears in the Pegasus attachment window. Had to upload it 'cause I couldn't get it to copy here. The Description column is as wide as possible yet the name is cut off at "... Install Six (". I also found the Content Type in the Raw View and included that in screen shot document. I'll summarize it here. The attachment type in the Raw View appears as: Content-Type: application/pdf; The attachment name in the Raw view is complete with ".pdf" as the file type: name="Proposal - Sunland Village East HOA - Fill Cracks and Voids - Coat and Stripe Six (6) Tennis Courts - Provide and Install Six (6) Tennis Nets - 03092024.pdf" It's a crazy long name, but it appears to be formatted correctly.

Confirmed using that identical filename. I counted 152 characters in that file name. Pegasus Mail stopped at 127, which is also the second open parenthesis. I make this reference because I also tested and attachment with a filename that contained the same characters but with the spaces and parenthesis removed. This reduced the filename to 140 characters, which Pegasus Mail handled correctly.


The question now is why the stop at 127 characters one long filename but not on another. I don't have a clue.


Confirmed using that identical filename. I counted 152 characters in that file name. Pegasus Mail stopped at 127, which is also the second open parenthesis. I make this reference because I also tested and attachment with a filename that contained the same characters but with the spaces and parenthesis removed. This reduced the filename to 140 characters, which Pegasus Mail handled correctly. The question now is why the stop at 127 characters one long filename but not on another. I don't have a clue.

The question now is why the stop at 127 characters one long filename but not on another. I don't have a clue.


In former 8.3 filename length times 127 was the max pathname length to be used on Windows systems (DOS legacy), but this doesn't explain why it now appears to handle 140 properly unless the current Windows MAX_PATH length (= 260 characters including path and filename) would have an impact - but maybe it makes exactly that difference between 140 and 152 and it would accept the overall 260 but truncate > 260 to down to 127?


[quote="pid:56498, uid:28772"]The question now is why the stop at 127 characters one long filename but not on another. I don't have a clue.[/quote] In former 8.3 filename length times 127 was the max pathname length to be used on Windows systems (DOS legacy), but this doesn't explain why it now appears to handle 140 properly unless the current Windows MAX_PATH length (= 260 characters including path and filename) would have an impact - but maybe it makes exactly *that* difference between 140 and 152 and it would accept the overall 260 but truncate > 260 to down to 127?
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C
edited Mar 13 at 10:20 pm

I was wrong about a 140 character filename being displayed. Further testing shows truncation is indeed occurring after 127 characters.


I was wrong about a 140 character filename being displayed. Further testing shows truncation is indeed occurring after 127 characters.
edited Mar 15 at 5:54 pm
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft