+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Specifying mime type for Documents & Files

Specifying mime type for Documents & Files

10 posts, 0 answered
  1. Chris Bryant
    Chris Bryant avatar
    33 posts
    Registered:
    07 Jul 2009
    24 Mar 2011
    Link to this post
    Hi,

    My site needs to support .M4V and .OGV videos using HTML5.  To do so, I'm adding the files to the "Documents & Files" section of Sitefinity 4.0.

    When browsing to the embed link to the file, it works; however, when placing this path in a <video> tag, the movie does not play.

    But, if I put the physical file in a subfolder of the site's root, it works.

    I think this is caused by the "Documents & Files" section of the CMS not allowing me to specify the MIME type.

    Is there a way to do this?
  2. Chris Bryant
    Chris Bryant avatar
    33 posts
    Registered:
    07 Jul 2009
    25 Mar 2011
    Link to this post

    Update -

    I used Fiddler to monitor the HTTP traffic while downloading the .M4V file that was uploaded to the Documents & Files section of Sitefinity 4.0.

    Here is the HTTP header info:

    HTTP/1.1 200 OK
    Cache-Control: public
    Content-Length: 7794028
    Content-Type: application/octet-stream
    Last-Modified: Wed, 23 Mar 2011 15:30:02 GMT
    Server: Microsoft-IIS/7.5
    content-disposition: inline; filename=case_study_final.m4v

    As you can see, the Content-Type is set to "application/octet-stream".  I need to customize this based on file type, such as, "video/m4v".

    How would I go about doing that?
  3. Chris Bryant
    Chris Bryant avatar
    33 posts
    Registered:
    07 Jul 2009
    28 Mar 2011
    Link to this post
    Telerik - Is there no suggested fix or workaround for this issue?

  4. Milena
    Milena avatar
    75 posts
    Registered:
    15 Jul 2016
    29 Mar 2011
    Link to this post
    Hi Chris Bryant,

     I logged a bug about this issue and we are going to review it on the next planing. I am sorry for inconvenience you are experiencing with this issue.

    For now you can workaround the problem by updating manually the MIME Type of a content item for corresponding extension in database.  For more details see attached file (MediaContentMimeType.jpg)


    All the best,

    Milena
    the Telerik team
  5. Chris Bryant
    Chris Bryant avatar
    33 posts
    Registered:
    07 Jul 2009
    29 Mar 2011
    Link to this post
    I've made progress on this issue, but I still had to build a custom upload control completely outside of the CMS to resolve this.

    Adding the MIME type to IIS resolved the content-type issue; however, Sitefinity returns all documents & files with a status code of 200.  But, streaming files, such as M4V and OGG require a status code of 206: Partial Content.

    In the next update, if we could specify the MIME type and support streaming file types, that would be great!
  6. Kalina
    Kalina avatar
    176 posts
    Registered:
    27 Oct 2016
    04 Apr 2011
    Link to this post
    Hello Chris,

    We added an option to specify MIME types for Files (Images, Videos, Document and Files) in section Settings.
    The feature will be available in our official release due next week.

    I hope this timing is OK with you.
    Thanks for taking the time to suggest this implementation!

    Greetings,
    Kalina
    the Telerik team

  7. Kurren
    Kurren avatar
    23 posts
    Registered:
    08 Jun 2013
    01 Apr 2014 in reply to Kalina
    Link to this post

    Was this ever released? I need to specify the mime type of my SVG files so that they can be displayed.

     Kurren

  8. Kaloyan
    Kaloyan avatar
    272 posts
    Registered:
    08 Dec 2016
    03 Apr 2014
    Link to this post
    Hello Kurren,

    We have provided an answer in your support ticket. You can feel free to share your solution with our community.

    Regards,
    Kaloyan
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  9. Adam
    Adam avatar
    23 posts
    Registered:
    05 Apr 2013
    10 Oct
    Link to this post
    Why can't you post the answer here as well for others to see?
  10. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    10 Oct in reply to Adam
    Link to this post

    Hi Adam, you can change mime type with outboundRules

    For example outbound rules for .svg and .mp3 files.

     

    <outboundRules>
        <rule name="MP3" preCondition="MP3 PC" patternSyntax="Wildcard" stopProcessing="true">
          <match serverVariable="RESPONSE_Content-Type" pattern="*" />
          <action type="Rewrite" value="audio/mpeg" />
          <conditions></conditions>
        </rule>
        <rule name="SVG" preCondition="SVG PC" patternSyntax="Wildcard" stopProcessing="true">
          <match serverVariable="RESPONSE_Content-Type" pattern="*" />
          <action type="Rewrite" value="image/svg+xml" />
          <conditions></conditions>
        </rule>
        <preConditions>
          <preCondition name="MP3 PC">
            <add input="{REQUEST_URI}" pattern=".mp3$" />
          </preCondition>
          <preCondition name="SVG PC">
            <add input="{REQUEST_URI}" pattern=".svg$" />
          </preCondition>
        </preConditions>
    </outboundRules>

     

    Let me know if you have problems with that

10 posts, 0 answered