RadEditor UploadPaths 绝对文件路径
我正在尝试将所有 RadEditor 文件管理器的 uploadpaths
设置为相同的绝对文件路径,并且还在同一台计算机上的几个解决方案之间共享相同的路径。
因此,我编写了一个方法来从 Web.Config 获取路径,并设置 FileManagerDialogConfiguration
对象上的所有属性(UploadPaths
、ViewPaths
、 ETC)。问题是这些属性正在寻找虚拟路径,而完整路径不起作用。
如何为属性提供可能/可能不在同一解决方案中的文件夹的虚拟路径?
这不起作用:
private static FileManagerDialogConfiguration fixPaths(FileManagerDialogConfiguration f, String[] path)
{
if (path[0][0] != '~')
{
Uri basePath = new Uri(ConfigurationManager.AppSettings["veMainPath"]);
Uri absPath = new Uri(path[0]);
Uri relPath = basePath.MakeRelativeUri(absPath);
path[0] = relPath.LocalPath;
}
f.ViewPaths = path;
f.UploadPaths = path;
f.DeletePaths = path;
f.MaxUploadFileSize = 10485760;
return f;
}
I am trying to set the uploadpaths
for all of the RadEditor File Managers to the same absolute file path, and also share the same path across a couple of Solutions on the same machine.
So, I wrote a method to get the path from the Web.Config and set all the Properties on the FileManagerDialogConfiguration
objects (UploadPaths
, ViewPaths
, etc). The problem is these properties are looking for Virtual Paths, and full paths don't work.
How can I supply the properties with the Virtual Path of a folder that may/may not be in the same Solution?
This didn't work:
private static FileManagerDialogConfiguration fixPaths(FileManagerDialogConfiguration f, String[] path)
{
if (path[0][0] != '~')
{
Uri basePath = new Uri(ConfigurationManager.AppSettings["veMainPath"]);
Uri absPath = new Uri(path[0]);
Uri relPath = basePath.MakeRelativeUri(absPath);
path[0] = relPath.LocalPath;
}
f.ViewPaths = path;
f.UploadPaths = path;
f.DeletePaths = path;
f.MaxUploadFileSize = 10485760;
return f;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论