【问题标题】:Permission error with ASP Classic on IIS using copyFileIIS 上使用 copyFile 的 ASP Classic 的权限错误
【发布时间】:2012-06-15 11:08:10
【问题描述】:

我正在编写一个在 IIS 7.0 上运行的 ASP 经典(使用 JScript)存储库,并且在移动文件时遇到了一些权限问题。我必须遵循总是给我一个权限被拒绝错误的通用函数。

function moveFile(source, target){
    fs = new ActiveXObject("Scripting.FileSystemObject");
    newloc = target + "\\" + source.name;
    debug("Copying file: " + source.path + " to " + newloc);
    fs.copyFile(source.path, Server.MapPath( "repository/" ), true);

}

当我使用源source.pathD:\Inetpub_EXT\wwwroot\builder\repo\dump\alicia.docx 和目标为D:\Inetpub_EXT\wwwroot\builder\repo\repository 调用函数时,我得到以下输出:

Treating dumpfile: alicia
Copying file: D:\Inetpub_EXT\builder\repo\dump\alicia.docx to 
D:\Inetpub_EXT\wwwroot\builder\repo\repository
Microsoft JScript runtime error '800a0046'
Permission denied 

我已验证文件夹和文件都存在,并且我在构建器中完全控制了 IIS_WPG、IUSR、Authenticated User、System 和 Administrators。

感谢您的帮助。

【问题讨论】:

    标签: file asp-classic jscript


    【解决方案1】:

    仔细检查您的权限。小心假设。

    例如,您可能假设如果 IIS 用户拥有builder 目录的权限,那么它就拥有所有子目录的权限。这不是一个好的假设。 如果您在builder 目录上设置ACL 以授予IIS 权限,则在创建子目录后,这些子目录不会自动继承您稍后应用于builder 的权限。

    可以在命令行使用icacls.exe查看权限:

     %windir\system32\icacls.exe  d:\inetpub\wwwroot\builder\foo\bar 
    

    【讨论】:

      猜你喜欢
      • 2011-12-01
      • 2018-02-25
      • 2017-02-27
      • 2012-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多