Specifying mime type for Documents & Files

Posted by Community Admin on 03-Aug-2018 16:55

Specifying mime type for Documents & Files

All Replies

Posted by Community Admin on 24-Mar-2011 00:00

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?

Posted by Community Admin on 25-Mar-2011 00:00

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?

Posted by Community Admin on 28-Mar-2011 00:00

Telerik - Is there no suggested fix or workaround for this issue?

Posted by Community Admin on 29-Mar-2011 00:00

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

Posted by Community Admin on 29-Mar-2011 00:00

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!

Posted by Community Admin on 04-Apr-2011 00:00

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


Posted by Community Admin on 01-Apr-2014 00:00

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

 Kurren

Posted by Community Admin on 03-Apr-2014 00:00

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
 

Posted by Community Admin on 10-Oct-2016 00:00

Why can't you post the answer here as well for others to see?

Posted by Community Admin on 10-Oct-2016 00:00

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

This thread is closed