[英]Copy file from internal server to remote server in IIS 7
I have an application written in c# that after creating a pdf file, needs to save this pdf file to a virtual folder in a remote server. 我有一个用C#编写的应用程序,在创建pdf文件后,需要将此pdf文件保存到远程服务器中的虚拟文件夹中。 The server is in DMZ and I already created two users in both servers with the same permissions.
该服务器位于DMZ中,我已经在两个服务器中创建了两个具有相同权限的用户。 The two servers are not in the same network.
两台服务器不在同一网络中。 I'm able to access a dummy pdf file using
我可以使用访问虚拟pdf文件
string stempSourceFilespec = "https://ServerName/VirtualFolder/dummy.pdf";
b = file bytes;
//Here I write the bytes
System.IO.File.WriteAllBytes(stempSourceFilespec, b)
, but I'm having problems when copying a pdf file to the same virtual directory. ,但是将pdf文件复制到同一虚拟目录时遇到问题。 The user I'm using has full permissions over that folder.
我使用的用户对该文件夹具有完全权限。
This works internally when using \\servername\\folder\\, but doesn't work when I try to save to a remote virtual directory. 这在使用\\ servername \\ folder \\时在内部起作用,但在尝试保存到远程虚拟目录时不起作用。 Any thoughts?
有什么想法吗?
try convert virtualpath to phyicalpath in a handler, such as system.web.httpserverUtil.mappath 尝试在处理程序(例如system.web.httpserverUtil.mappath)中将virtualpath转换为phyicalpath
http://asp.net.bigresource.com/Uploading-files-to-server-and-saving-outside-virtual-path-bMVjFTYf4.html#l9LpkWyji http://asp.net.bigresource.com/Uploading-files-to-server-and-saving-outside-virtual-path-bMVjFTYf4.html#l9LpkWyji
http://forums.iis.net/t/1157234.aspx http://forums.iis.net/t/1157234.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.