Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Cassini and MIME types (.flv)
ghawkes
#1 Posted : Tuesday, June 16, 2009 8:12:40 AM(UTC)
Groups: Member
Joined: 6/16/2009(UTC)
Posts: 6

Hello,

I am using IIS to host an ASP.NET website with embedded Flash. Inside of this Flash I am using the .flv video format. To get this working in IIS I had to add the following entry in my MIME types:

Extension: .flv
MIME type: application/x-shockwave-flash

I did not see an option of MIME types with Cassini. How can I set this in Cassini for a local install? Thanks.

- G

Ultidev Team
#2 Posted : Tuesday, June 16, 2009 10:01:32 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there!

When it comes to serving files of unknown to UltiDev Cassini nature, Cassini has a couple of flaws going all the way back to original MS Cassini sample:
- One, is that it's impossible (in this version) to do what you are looking for - to assign a MIME type to a given file extension.
- Another is not generating caching headers that would eliminate of repeated downloads of content files.

To work around these issues, until they are fixed in the next release of Cassini, we recommend implementing a simple but efficient IHttpHandler and associating it with the file extension that is not served properly. This way you can take care of all the issues: speed, MIME type and caching.

To be concrete, here’s the outline of what you may want to do in order to implement the workaround.
- Start with creating an IHttpHandler that will handle .FLV, .SWF and other file types of your choosing, instead of default Cassini logic.
- We will do our part and provide the sample of the handler that will be very-very close to what you will want to do. The sample handler does serve files straight up, but also does the caching instructions. The only differences will be:
--- you will use request.MapPath() to find the physical location of the requested file, instead of UtilityMethods.GetPathByHash(),
--- content type will be “application/x-shockwave-flash” for .FLV and whichever one is right for the .SWF file. Other types corresponding to any other file extensions can be handled this way.
--- The “Content-Disposition” header won’t be necessary – using it may cause browser to prompt users to save the file.
- Please note that Returned304() methods used in the sample are implemented here.

Please let us know if you were able to implement this handler and whether it has helped.

Best regards,
UltiDev Team.

Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest (4)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.