OK, here it is. Sorry it took a while.
We have modified the sample mentioned in our previous post to be a solution to the lack of the "Range" header support in UltiDev Cassini. Here's what we've added:
- Support of any file types, not only .zip;
- Correct "content-type" header value for many known file types;
- Generating "eTag" header value based on file's name, size and last modification date;
To plug this module into your application download the
binary of the module, extract PartialContentHandler.dll into your application's Bin folder, and modify your web.config to include following section:
Code:<system.web>
<httpHandlers>
<add verb="*" path="*.*" type="PartialContentSupportHandler.FileServerHandler, PartialContentHandler"/>
</httpHandlers>
</system.web>
The snippet above will serve all files types, including .ASPX and .CONFIG, as files. So if you need to serve just a few types of files as files and leave others as executable or scripts, use multiple <add> entire with different path attribute values, like
<add path="*.mp3"... />
<add path="*.wma"... />
etc. For more details on how to configure <httpHandlers> section refer to the
MSDN article on the subject.
If you do not have an application with ASPX or ASMX scripts, and your application is a pure file server, you can simply unzip the
content of the archive with module implementation into the folder registered with Cassini Server as application root and be done with it - it will handle all files and support "range" header.
If you are interested in modifying and adapting the sample to your needs, please feel free to
download the project. If you come up with some good additions, please make your improved module available to the community, if possible.
Please let us know if this information has helped.
Best regards,
UltiDev Team.
Please donate at
http://www.ultidev.com/products/Donate.aspx to help us improve our products.