locked
How to check for MIME Type instead of file extension when uploading/downloading a file in sp 2007? RRS feed

Answers

  • Hi

    >Is this by default possible in sharepoint 2007?

    As per my knowledge, sharepoint block the files based on central admin settings (as you already know about this) so i am not aware about any other default way where you can restrict MIME type.

    Please consider extension and add them in CA or add event handler to restrict them.

    Hope it could help


    Hemendra: "Yesterday is just a memory,Tomorrow we may never see"

    Whenever you see a reply and if you think is helpful, click "Alternate TextVote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Alternate TextMark As Answer

    Please feel free to unmark answer if does not resolves your problem.

    • Marked as answer by [Yavuz B.] Friday, April 12, 2013 6:59 AM
    Friday, April 12, 2013 4:35 AM
    Moderator

All replies

  • Hi,

    Here is the list of all MIME file type, which you can use in event handler (ie. ItemUpdating event) while uploading a file in library:

    http://stackoverflow.com/questions/1029740/get-mime-type-from-extension

    I am not sure about downloading because download does not have any event by default.

    Hope it could help


    Hemendra: "Yesterday is just a memory,Tomorrow we may never see"

    Whenever you see a reply and if you think is helpful, click "Alternate TextVote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Alternate TextMark As Answer

    Please feel free to unmark answer if does not resolves your problem.

    Thursday, April 11, 2013 8:25 AM
    Moderator
  • Hi Hemendra,

    thank you for your reply. But that is not what i was looking for. I know how to programmatically check for mime types in code behind / events, but i am searching for a way how to do this in sharepoint by default. I mean, i know how to block files by file extension and i am looking for a way to block or allow file types by mime type not by extension.

    Is this by default possible in sharepoint 2007? I hoe this post clearifies my first question.


    Best regards,
    Yavuz B.

    My Sharepoint and Enterprise 2.0 Blog http://www.bogazci.com | Microsoft Sharepoint Resources & Blog List

    Thursday, April 11, 2013 8:33 AM
  • Hi

    >Is this by default possible in sharepoint 2007?

    As per my knowledge, sharepoint block the files based on central admin settings (as you already know about this) so i am not aware about any other default way where you can restrict MIME type.

    Please consider extension and add them in CA or add event handler to restrict them.

    Hope it could help


    Hemendra: "Yesterday is just a memory,Tomorrow we may never see"

    Whenever you see a reply and if you think is helpful, click "Alternate TextVote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Alternate TextMark As Answer

    Please feel free to unmark answer if does not resolves your problem.

    • Marked as answer by [Yavuz B.] Friday, April 12, 2013 6:59 AM
    Friday, April 12, 2013 4:35 AM
    Moderator