KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am attempting to produce a simple WebDAV server using MVC, and I have finally reached the stage where I need to serve up a requested file to the user. I have a route set up that deals with traversing the directory structure "webdav/{*path}" which works fine, right up until the point where that path ends in a file name. At this point, it appears that IIS decides that it is a static file, and attempts to serve that file from the disk. As it isn't in the location specified in the URL, it returns a 404 error. I don't have any freedom to change the url, I basically need it to be in the form, otherwise Windows Explorer can't work with it as a mapped drive: GET /webdav/Test/Test2.txt I've set the route to greedily match, as the directory structure can have as many levels. I've also set routes.RouteExistingFiles = true; This is using IIS Express 8.0 on my development machine. I've gone as far as setting up a blank MVC project just to test this, and this is the RegisterRoutes method: routes.RouteExistingFiles = true; routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "WebDAVGet", url: "webdav/{*path}", defaults: new { controller = "WebDAV", action = "Get", path = "" }); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); So, going to /webdav/Test/Test2 hits the breakpoint in my controller, but going to /webdav/Test/Test2.txt gives me a 404. Any suggestions?
Tags (comma-separated)
Save Edits
Cancel