Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Serving MP3s and other media file types in .Text

Stage Three of the .Text freelance project went online today which included the support of uploads as post attachments and RSS support for enclosures.  I'll post code-centric info on that coming up, but wanted to first mention how to serve MP3s, M4B, WMA and other files from a community .Text site on Windows 2003 Server.  This stomped me for a bit this morning, so I wanted to pass along the solution.

Let's say the files are located in a subdirectory off the site root directory called /UPLOADS.  If you try to access them via http://MYCOMMUNITYBLOG/UPLOADS you'll receive “Resource Cannot Be Found“ and that's all you'll receive. 

There are two ways to make this work.  The first is to remove aspnet_isapi.dll wildcard extension mapping to that directory.  The second way to enable serving up media file types is to add them in the .Text web.config HttpHandler section on the following line as shown:

<HttpHandler pattern = "(\.gif|\.js|\.jpg|\.zip|\.jpeg|\.jpe|\.css|\.mp3|\.m4b|\.wma)$" type = "Dottext.Common.UrlManager.BlogStaticFileHandler, Dottext.Common" handlerType = "Direct" />

Comments (4) | Post RSS RSS comment feed

Posted on 12/21/2004 9:14:00 PM by Dave Burke
Categories:
Tags:

Related posts

Comments (4) -

12/22/2004 6:42:00 AM Permalink

Thanks for the tip!

Erik Lane |

12/22/2004 6:53:00 AM Permalink

Interesting, Joel Ross just posted today about how serving MP3s with HttpHandlers would be a bad thing.

www.rosscode.com/.../index.php">www.rosscode.com/.../index.php

Dave Burke |

12/22/2004 7:05:00 AM Permalink

It's amazing to me how lots of people seem to pick up on the same topic at the same time in the blogs!

Anyway, the .Text modification series of posts are awesome! Keep them coming!

Joel Ross |

12/22/2004 7:11:00 AM Permalink

Joel,  Thanks very much for the motivation in getting more posts on .text modification online.  Will do!

Dave Burke |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke