2013-05-08 165 views
1

我在我的项目中使用了elFiner(带有elFinder连接器),并且在localhost上运行良好。
但是,当我部署到服务器(在线托管),它给了我一个错误target dir not found or access denied。这是我的配置;设置网站托管(IIS 7+)的elFinder的正确路径

<elFinder apiVersion="2.0" 
      localFSRootDirectoryPath="D:\Projects\Emaar\Emaar.Web\Areas\EmaarAdmin\Content\images" 
      localFSThumbsDirectoryPath="D:\Projects\Emaar\Emaar.Web\Areas\EmaarAdmin\Content\images\.thumbs" 
      rootDirectoryName="Root" 
      uploadMaxSize="20M" 
      defaultVolumeName="LocalFileSystem" 
      baseUrl="http://localhost:4595/Areas/EmaarAdmin/Content/images/" 
      baseThumbsUrl="http://localhost:4595/Areas/EmaarAdmin/Content/images/.thumbs/" 
      duplicateFilePattern="Copy of {0}" 
      duplicateDirectoryPattern="Copy of {0}" 
      thumbsSize="48,48"> 
    </elFinder> 

我相信我的路径在我的web.config中不正确。
我如何设置elFinder也可以在线(在网上)工作?
更新:我的在线设置看起来像这样;

<elFinder apiVersion="2.0" localFSRootDirectoryPath="\Areas\EmaarAdmin\Content" 
localFSThumbsDirectoryPath="\Areas\EmaarAdmin\Content\.thumbs" 
rootDirectoryName="Root Main" uploadMaxSize="20M" defaultVolumeName="LocalFileSystem" 
baseUrl="http://subdomain.domain.com/Areas/EmaarAdmin/Content/" 
baseThumbsUrl="http://subdomain.domain.com/Areas/EmaarAdmin/Content/.thumbs/" 
duplicateFilePattern="Copy of {0}" duplicateDirectoryPattern="Copy of {0}" thumbsSize="48,48"> 

我还设置权限为ReadWrite

回答

1

我做一个简单的一招解决了这个问题。首先我写了下面的代码,并将其放在_Layout(剃须刀)文件中。

@HttpContext.Current.Request.PhysicalApplicationPath 

这给了我一个物理路径,然后我只是复制并粘贴在localFSRootDirectoryPathlocalFSThumbsDirectoryPath内,它的工作