RadEditor UploadPaths 绝对文件路径

发布于 2024-09-18 04:01:05 字数 853 浏览 7 评论 0原文

我正在尝试将所有 RadEditor 文件管理器的 uploadpaths 设置为相同的绝对文件路径,并且在同一台计算机上的几个解决方案之间共享相同的路径。

因此,我编写了一个方法来从 Web.Config 获取路径,并设置 FileManagerDialogConfiguration 对象上的所有属性(UploadPathsViewPaths、 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文