heluxsh / skpsmtpmessage

Automatically exported from code.google.com/p/skpsmtpmessage
0 stars 0 forks source link

File extension inappropriately renamed to .VCF #25

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have successfully used SKPSMTPMessage to attach files and communicate
with Gmail SMTP servers.  I am, however, experiencing a strange side
affect.  When I download the file from the email, on a Mac the file gets
renamed to the .VCF file extension, even though the actual file is a
different extension (.txt, .csv, etc.).  It seems like Mac OS is actually
renaming the file, because in my email client, the file extension looks
right.  Also, downloading on a PC works just fine.  

I have debugged literally the entire code path that executes when the
message is sent, and everything seems to be in order.  Is there some
metadata that gets associated with the attached file that is not correct?  

Thanks in advance for any help.

Jeremy

Original issue reported on code.google.com by jeremy...@gmail.com on 5 Mar 2009 at 5:52

GoogleCodeExporter commented 8 years ago
In addition to the information above, I would like to add that if anyone is 
willing
to help me on this, I can forward the email with the attachment. Thanks.

Jeremy

Original comment by jeremy...@gmail.com on 5 Mar 2009 at 5:54

GoogleCodeExporter commented 8 years ago
I removed the VCF and just set the parameters from the xib controller. It 
worked 
fine.

Original comment by mchar...@iapphealth.com on 8 Mar 2009 at 10:43

GoogleCodeExporter commented 8 years ago
I have the exact same problem as Jeremy. Works fine on PC, but on my Mac the 
CAF-files I sent got a .vcf-
ending. For txt and jpg-files it did not get the .vcf-ending.

Original comment by hes...@gmail.com on 10 Mar 2009 at 1:34

GoogleCodeExporter commented 8 years ago
To add some more information, it seems to happen to just some file types. I 
tried today with AIFF and AIFC and it 
worked fine, but i still got vcf on the caf-file

Original comment by hes...@gmail.com on 11 Mar 2009 at 12:09

GoogleCodeExporter commented 8 years ago
Has anyone found a way around this?  My app uses this to send PDF files, and it 
adds the VCF extension only 
under certain circumstances (one of which is the iPhone's email app, and 
another being hotmail on a Mac 
computer).  Thoughts?

I'm desperate for a solution, as it's upsetting quite a few users.  Thanks!!

Original comment by svguer...@gmail.com on 15 Jul 2009 at 9:34

GoogleCodeExporter commented 8 years ago
Look in the code for the dictionary of the file attachment part.
For the key kSKPSMTPPartContentTypeKey, the first part of the string defines 
the content-type of the 
attachment. If you leave this as text/directory, then Macs will think it is a 
directory-type file because Macs 
largely ignore the file extension. Change the line to the content-type it is 
supposed to be.
http://en.wikipedia.org/wiki/Internet_media_type#List_of_common_media_types

Original comment by bull...@gmail.com on 11 Sep 2009 at 3:11