如何从位于同一局域网中的其他服务器访问文件 [英] how to access file from other server located in same lan

查看:369
本文介绍了如何从位于同一局域网中的其他服务器访问文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我使用c#asp.net 2.0开发了一个站点,该站点用于在数据库中搜索文档名称,相关的文章在
中提供 其他服务器,必须为其提供客户端下载链接.

在我的开发系统上可以正常工作,但是在托管时不能正常工作.

示例:
让服务器A成为数据库服务器
让服务器B成为iis服务器
让服务器C成为服务器,获取可用的物理内存

注意:所有文件都在同一个域中,并且要从其访问和下载的文件夹是共享文件夹.

我将网站托管在"B"中,该网站在"A"中搜索文件,并提供了一个链接,用于从"C"为客户端下载该文件.

但是,如果我在可提供文档的服务器"C"上托管此站点,则工作正常.

请帮助
预先感谢

Hi Every One

I developed a site using c# asp.net 2.0 , which is used for search the document name in the database and the related doument is available in
other server which has to be given a link for download for client.

Working fine at my development system , but not working when hosted .

Example:
let server A be database server
let server B be iis server
let server C be server wehre the physical socuments available

Note: all are in the same domain ,and the folder from which the to be accessed and download is a shared folder.

i hosted the the site in ''B'' which search''s the file in ''A'' and a link to be given for downloading that file for the client from ''C''

But It is working fine if i host this site on server ''C'' where the documents available.

Please Help
Thanx in advance

推荐答案

这不起作用,因为客户端无法访问服务器C.由于客户端位于同一LAN上,因此在开发中有效.您需要做的是将文件从IIS服务器流式传输到客户端.这是在ASP.NET中执行此操作的示例:

This does not work because the clients do not have access to the server C. It works in development because your client is on the same LAN. What you need to do is to stream the file to client from the IIS server. Here is an example to do this in ASP.NET:

Response.WriteFile(@"\\C\documents\document.doc");



当然,由于您需要将文件的MIME类型放在标头中,因此完整的解决方案将更加复杂.

这是另一篇描述该过程的文章:

http://support.microsoft.com/kb/306654/ [



Of course, a full solution will be more complex as you need to put the MIME Type of the file in the header.

Here is another article that describes the process:

http://support.microsoft.com/kb/306654/[^]


这篇关于如何从位于同一局域网中的其他服务器访问文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆