[英]Uploading files to remote server using ASP.Net(VB) 1.1
I have a file uploading and viewing page in ASP.Net 1.1 using VB. 我在ASP.Net 1.1中使用VB上传和查看文件。 Now the page will be visible in intranet as well internet.
现在,该页面将在Intranet和Internet中可见。 Here in my case the intranet and internet servers are different.
在本例中,Intranet和Internet服务器是不同的。 How can i save the uploaded file in the intranet server and view from there subsequently when the activity is done using the internet server?
使用互联网服务器完成活动后,如何将上载的文件保存在Intranet服务器中并随后从那里查看?
I'd suggest that you have both instances of the application (intranet and internet) save their uploaded files to a common location. 我建议您同时拥有应用程序的两个实例(内部网和Internet),将其上传的文件保存到公共位置。 I'm going to assume, given that you're targeting .net 1.1 that you're probably looking for a solution/directions for IIS 6.0 or below, rather than the 7.x that comes with Vista/Server 2008.
假设您以.net 1.1为目标,那么您可能正在寻找IIS 6.0或更低版本的解决方案/说明,而不是Vista / Server 2008随附的7.x。
You need to firstly decide where you're going to store the uploaded files, it could be on the Intranet server, the Internet server or a 3rd "filestore" server. 您首先需要确定要在何处存储上载的文件,它可以在Intranet服务器,Internet服务器或第三台“文件存储”服务器上。 Having done that, you can map that location to a commonly named Virtual Directory on each of your two web servers as follows:
完成此操作后,可以将该位置映射到两个Web服务器中的每一个上的通用虚拟目录,如下所示:
SharedUploadFiles
SharedUploadFiles
类的SharedUploadFiles
\\\\192.168.100.1\\SharedUploadFilesStore
(ie wherever you've chosen to store the files \\\\192.168.100.1\\SharedUploadFilesStore
类的路径(即,无论您选择存储文件的位置如何) Your application will now be able to access files in that share as if they were part of your web servers file system. 现在,您的应用程序将能够访问该共享中的文件,就像它们是Web服务器文件系统的一部分一样。 So, if you had a file located at
\\\\192.168.100.1\\SharedUploadFilesStore\\sample.txt
, you would then be able to access it through both: 因此,如果您的文件位于
\\\\192.168.100.1\\SharedUploadFilesStore\\sample.txt
,则可以通过以下两种方式访问该文件:
http://internetdomain.name/MyWebAppName/SharedUploadFiles/sample.txt
and 和
http://intranet.mycompany.local/MyWebAppName/SharedUploadFiles/sample.txt
My knowledge of how to solve any issues you encounter whilst configuring this isn't that deep, and you'd probably get a better answer at http://www.serverfault.com/ as whilst your question is a programming one, the answer I've given isn't a programmatic solution (not that it always has to be! =) 我对如何解决在配置此程序时遇到的任何问题的了解并不深,您可能会在http://www.serverfault.com/上获得更好的答案,因为您的问题是编程问题,而答案是我给出的不是程序化解决方案(并非总是如此!=)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.