【问题标题】:Copy file from internal server to remote server in IIS 7在 IIS 7 中将文件从内部服务器复制到远程服务器
【发布时间】:2013-08-07 13:44:37
【问题描述】:

我有一个用 c# 编写的应用程序,在创建 pdf 文件后,需要将此 pdf 文件保存到远程服务器中的虚拟文件夹中。服务器位于 DMZ 中,我已经在两台服务器中创建了两个具有相同权限的用户。两台服务器不在同一个网络中。我可以使用

访问虚拟 pdf 文件
string stempSourceFilespec = "https://ServerName/VirtualFolder/dummy.pdf";
b = file bytes;
//Here I write the bytes
System.IO.File.WriteAllBytes(stempSourceFilespec, b)

,但我在将 pdf 文件复制到同一虚拟目录时遇到问题。我使用的用户对该文件夹拥有完全权限。

这在使用 \servername\folder\ 时在内部起作用,但在我尝试保存到远程虚拟目录时不起作用。有什么想法吗?

【问题讨论】:

  • 也许您应该在远程服务器上设置 FTP。

标签: c# asp.net iis networking


【解决方案1】:

尝试在处理程序中将虚拟路径转换为物理路径,例如 system.web.httpserverUtil.mappath

http://asp.net.bigresource.com/Uploading-files-to-server-and-saving-outside-virtual-path-bMVjFTYf4.html#l9LpkWyji

http://forums.iis.net/t/1157234.aspx

【讨论】:

    猜你喜欢
    • 2019-01-20
    • 1970-01-01
    • 1970-01-01
    • 2010-09-24
    • 2011-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-28
    相关资源
    最近更新 更多