如何在不使用文件上传控件的情况下将文件从本地复制到远程服务器 [英] how to copy files from Local to remote server without using fileupload control

查看:52
本文介绍了如何在不使用文件上传控件的情况下将文件从本地复制到远程服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试通过应用程序将文件从本地复制到远程服务器.它不应使用fileupload控制.如果我在文本框中指定本地路径并单击一个按钮,则该路径中存在的文件应复制到远程服务器中的路径.如果我将目的地指定为本地服务器路径,则可以执行此操作.但是不能,如果我指定了远程服务器路径.我该怎么办?

我使用了 File.Copy(sourceFileName,destFileName).如果我使用此方法并将"destFileName"指定为远程服务器路径,则它不起作用.

在此先感谢您.

Hi,
I am trying to copy a file from my local to remote server through an application. It should not use fileupload control. If I am specifies the local path in a text box and click a button means, the file present in the path should be copied to a path in remote server. I can do this if i specified the destination as a local server path. But cant if i specified the remote server path. How can I do this?

I used File.Copy(sourceFileName, destFileName). If i used this method and specify the ''destFileName'' as remote server path, it is not working.

Thanks in advance.

推荐答案

您需要确定通过哪种机制传输文件.如果是直接副本,则可能要在服务器上共享一个文件夹,以便您的进程在其下运行的帐户可以访问它.

如果服务器运行的是ASP网站,则可能希望有一个可以处理它的上载页面.
You need to decide by what mechanism you''re going to transfer the file. If it''s a straight copy, you may want to share a folder on the server so that the account your process runs under can access it.

If the server is running an ASP website, perhaps you want to have an upload page which can handle it.


这篇关于如何在不使用文件上传控件的情况下将文件从本地复制到远程服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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