我有一个解决方案与2个项目中,一个称为“管理”,另一个说“工作”(一个Umbraco实例)-工作有一个图像文件夹,其中包含网站的横幅/缩略图等图像-管理允许管理员用户添加新的故事,与图像,使用TinyMCE
and the fileman plug in.所以在IIS中我在Admin中创建了一个虚拟文件夹,它指向工作中的图像文件夹,但是当我尝试浏览fileman中的文件夹时,它重复了很多子目录,并且没有显示任何images.And,我也无法上传任何图像,它只是给了我一个错误。在conf.json文件中,Files_Root条目如下所示。
"FILES_ROOT": ".//images//",那么我如何让这个虚拟文件夹与fileman一起工作呢?
发布于 2015-06-12 03:57:14
我也偶然发现了这个问题--当FILES_ROOT指向IIS中的一个虚拟文件夹时,Fileman组件在尝试检索文件列表时、上传文件时以及其他一些地方都会卡住。当请求引用虚拟目录时,它不会正确传递文件夹位置。如果您在其上安装了网络嗅探器,您将看到发送到fileman/asp_net/main.ashx的请求以及返回错误消息“不支持给定路径的格式”的响应。
我已经通过网站向作者报告了这个错误,但我也发现,如果用SYMLINK替换虚拟目录,一切似乎都可以正常工作。
如果您有IIS访问权限,那么您可能有命令行访问权限来创建符号链接,这可以通过以下方式完成:
mklink /j "{virtual location within your website}" "{physical location}"这两个位置都应该是完整路径,包括驱动器号,并且“虚拟”位置应该在您的网站根目录中。
到目前为止,除了我的站点备份开始包括symlink中的文件之外,我还没有看到以这种方式引用文件而不是使用虚拟目录的问题,因为操作系统现在将其视为站点内的物理文件夹。
我希望这对你有帮助!
发布于 2020-06-06 05:28:40
可能不是每种情况都适合(甚至可能不是对提出问题的用户),但我想我会分享,以防它可能会帮助那些试图将虚拟目录映射到网络共享的人。我需要修改文件fileman/asp_net/main.ashx中的ListDirTree函数
protected void ListDirTree(string type)
{
string filesRoot = GetFilesRoot();
DirectoryInfo d = new DirectoryInfo( filesRoot );
if ( !d.Exists )
throw new Exception( "Invalid files root directory. Check your configuration: " + filesRoot );
ArrayList dirs = ListDirs( d.FullName );
dirs.Insert( 0, d.FullName );
string localPath = _context.Server.MapPath( "~/" );
bool isLocal = filesRoot.Contains( ":" );
_r.Write( "[" );
for ( int i = 0; i < dirs.Count; i++ )
{
string dir = (string)dirs[i];
string lPath;
//If it is a local path, leave it as it was
if ( isLocal )
lPath = dir.Replace( localPath, "" ).Replace( "\\", "/" );
else
//Otherwise probably a virtual directory, put the original files_root location back
lPath = dir.Replace( filesRoot, GetSetting( "FILES_ROOT" ) ).Replace( "\\", "/" );
_r.Write( "{\"p\":\"/" + lPath + "\",\"f\":\"" + GetFiles( dir, type ).Count.ToString() + "\",\"d\":\"" + Directory.GetDirectories( dir ).Length.ToString() + "\"}" );
if ( i < dirs.Count - 1 )
_r.Write( "," );
}
_r.Write( "]" );
}https://stackoverflow.com/questions/27988001
复制相似问题