SaaS CMS has officially launched! Learn more now.

VirtualPath to existing folder?


How do i create a virtualpath to an existing folder (containing files)?

I have created a "upload"-folder by adding the following line to web.config, and this works just fine.

<add showInFileManager="true" virtualName="Upload" virtualPath="~/Upload/"
          bypassAccessCheck="false" physicalPath="D:\some\path\Upload"
          name="SiteUpload" type="EPiServer.Web.Hosting.VirtualPathVersioningProvider,EPiServer" />

 I was sure it would be just as easy to point to an exisitng folder (containing files) and just use VirtualPathNativeProvider. It shows up in filemanager, but i get error 404 when trying to browse the files... what did i miss?

Sep 09, 2009 16:28

You need to add the path in the web.config like this

<location path="Upload">
    <staticFile expirationTime="-1.0:0:0" />
        <add name="webresources" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
        <add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />

Sep 09, 2009 21:52
If you are using IIS 5/6 it could also be a problem with access rights in the local filesystem. For some reason that manifests itself as 404 and not some kind of access denied error.
Sep 10, 2009 7:57


Tested with the config in you first post, but changed it to use VirtualPathVersioningProvider instead of versioning. I assume you did the same since you mentioned the native provider in your post. Anyway, worked like a charm for me.

Give the suggestions from Anders and Magnus a try and see if they solve the problem. Because what you are trying to do should work.


Per Gunsarfs
EPiServer CMS development team

Sep 10, 2009 12:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.