Skip to main content
July 18, 2013
Question

CF10,0,11,285437 global UNC Mapping does not work?

  • July 18, 2013
  • 1 reply
  • 3115 views

Maybe the way global UNC mappings are supposed to be added has changed?

When I under ColdFusion 9 add the following mapping via the adminstrator interface:

Logical Path = /SharedFiles

Directory Path = \\webroot\sites\_SharedFiles

The url http://somesite.com has it's path set to \\webroot\sites\somesite in IIS7.5

Browsing http://somesite.com/SharedFiles/some.cfm renders the cfm fine, since the CF9 mapping for SharedFiles works without any issue.

When I under ColdFusion 10,0,11,285437 add the following mapping via the adminstrator interface:

Logical Path = /SharedFiles

Directory Path = \\webroot\sites\_SharedFiles

Again, the url http://somesite.com has it's path set to \\webroot\sites\somesite in IIS7.5

First thing I notice as different is that CF10 shows the Directory Path as //webroot/sites/_SharedFile instead of \\webroot\sites\_SharedFiles
Clicking EDIT still has the Directory Path exact as I wrote it thou...

Browsing the url http://somesite.com/SharedFiles/some.cfm throws a 404 Not Found, since the mapping doesn't work with CF10, it points to \\webroot\sites\somesite\SharedFiles\some.cfm instead of what is specified in the mapping.

This is rather critical when hundreds of sites are setup to use such a global mapping, and we can't really switch to CF10 before this works again.

Message was edited by: F4798w85gasdg

Added some red and blue color to make it easier to read

    This topic has been closed for replies.

    1 reply

    Carl Von Stetten
    Legend
    July 18, 2013

    F4798w85gasdg,

    I believe you need an IIS virtual directory set up if you're looking to browse files in the "_SharedFiles" folder, because it is outside of the "somesite" folder.  ColdFusion mappings only allow ColdFusion to see resources outside the web root for tags and functions like <cfinclude> and CreateObject().  They don't allow the web server to access those locations.  Virtual directories in IIS allow you to browse to locations outside the web root.

    -Carl V.

    July 19, 2013

    Carl, as I already wrote, mapping to globally shared folders outside some sites root folder does work fine with CF7/8, for some reason CF10 doesn't manage to resolve it like previous CF versions.

    We have several hundred production websites running with global mapping trough CF8, and really need this feature to work in CF10 before doing an upgrade.

    So adding virtual directories or using tags and functions is not an option.

    I know that Railo 4 had the same issue, but they fixet it, so why can't this be done in a paid product like ColdFusion 10?!?

    EDIT: Just a correction.

    I just double checket the CF9 test server vs CF8 production servers, UNC mapping only works correct up to and including CF8.

    Carl Von Stetten
    Legend
    July 19, 2013

    Joe,

    You've described specifically an issue related to *browsing* to files that are not in the webroot.  Web page requests are initially handled by the web server (IIS, Apache, etc.), and if found (or if a URL rewrite rule redirects), are passed to ColdFusion for processing.  Generally speaking, ColdFusion server does not throw 404 errors (unless you specifically have code that sets page headers and such); web servers throw 404 errors.  So the fact that you're getting 404 errors tells me that your *web server* doesn't know where the files are, because there are no virtual directories configured to tell it where they are.

    Have you checked your CF7/8 sites to see if there are virtual directories configured for these sites?  ColdFusion mappings only allow ColdFusion to access files outside the webroot when doing ColdFusion stuff (like CFINCLUDE or CreateObject).  Without virtual directories, I would absolutely expect to see 404 errors when trying to browse a file that is outside the webroot.

    -Carl V.