This project has moved and is read-only. For the latest updates, please go here.

différence between UseFileServer and UseStaticFiles

May 7, 2014 at 12:17 PM
Hi

What is the différence between UseFileServer and UseStaticFiles?
Why did you develop both?

thanks
May 7, 2014 at 2:03 PM
File Server is composed of several other middlewares, "Static Files" is one of them. So as you can see, Static File middleware is a subset of File Server middleware.

UseStaticFiles is limited in a sense it allows you to only server files from a specific directory under the root of your application. Directory browsing and Default Files features are turned on.

UseFileServer on the other hand is more generic and gives you more options to configure. For instance, you can turn on Directory Browsing, Default Files, and Static Files.

Run this sample code to sense youself the difference: https://aspnet.codeplex.com/SourceControl/latest#Samples/Katana/StaticFilesSample/Startup.cs

Good luck!

HTH,
Bilal
Marked as answer by Tratcher on 5/21/2014 at 2:11 PM
May 7, 2014 at 5:22 PM
Marked as answer by Tratcher on 5/21/2014 at 2:11 PM