locked
MIME Type for file attachment in windows forms application RRS feed

  • Question

  • In a web application their is a ContentType property for uploaded files.  However, I can't seem to find an equivalent property on System.IO.File while working with files in a windows forms application.  Is there a way to get the MIME type of a file in a windows forms application?  Any help would be greatly appreciated.

     

    Jason

    Friday, December 28, 2007 10:13 PM

Answers

  • Hi Jason,

     

    I don't think that an equivalent property about MIME exists in System.IO.File. The following introduction about MIME comes from http://en.wikipedia.org/wiki/MIME

    Multipurpose Internet Mail Extensions (MIME) is an Internet Standard that extends the format of e-mail to support:

    1. text in character sets other than US-ASCII;
    2. non-text attachments;
    3. multi-part message bodies; and
    4. header information in non-ASCII character sets.

    Virtually all human-written Internet e-mail and a fairly large proportion of automated e-mail is transmitted via SMTP in MIME format. Internet e-mail is so closely associated with the SMTP and MIME standards that it is sometimes called SMTP/MIME e-mail. The content types defined by MIME standards are also of importance outside of e-mail, such as in communication protocols like HTTP for the World Wide Web. HTTP requires that data be transmitted in the context of e-mail-like messages, even though the data may not actually be e-mail.

     

    This introduction shoulds give good explanation about the problem. If you have any further questions, please tell me.

     

     

    Best regards,

    Riquel

    Wednesday, January 2, 2008 10:42 AM

All replies

  • Hi Jason,

     

    I don't think that an equivalent property about MIME exists in System.IO.File. The following introduction about MIME comes from http://en.wikipedia.org/wiki/MIME

    Multipurpose Internet Mail Extensions (MIME) is an Internet Standard that extends the format of e-mail to support:

    1. text in character sets other than US-ASCII;
    2. non-text attachments;
    3. multi-part message bodies; and
    4. header information in non-ASCII character sets.

    Virtually all human-written Internet e-mail and a fairly large proportion of automated e-mail is transmitted via SMTP in MIME format. Internet e-mail is so closely associated with the SMTP and MIME standards that it is sometimes called SMTP/MIME e-mail. The content types defined by MIME standards are also of importance outside of e-mail, such as in communication protocols like HTTP for the World Wide Web. HTTP requires that data be transmitted in the context of e-mail-like messages, even though the data may not actually be e-mail.

     

    This introduction shoulds give good explanation about the problem. If you have any further questions, please tell me.

     

     

    Best regards,

    Riquel

    Wednesday, January 2, 2008 10:42 AM
  •  

    Thanks for your help!  After I thought about it some more, I probably don't need to worry about evaluating this on our internal network.  In my situation the user will be uploading a file from a share or from their local desktop to another share.  The user could simply run the corrupt file from one of the shares they already have access to and we would be in the same boat.

     

    Jason

    Friday, January 4, 2008 9:53 PM