上传文件到另一台服务器 [英] upload files to a different server

查看:240
本文介绍了上传文件到另一台服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Web应用程序都在服务器D.因此,我创建一个具有FileUpload控件的Web应用程序。我可以很容易地上传任何文件到Web应用程序中的文件夹(文件)。

我现在的问题:我如何上传同一文件(由code后面)到一个文件夹(上传)不同的服务器(SERVER T),我有吗?我还需要读,写和修改的服务器T.该文件还记得,我使用Web窗体而不是Windows窗体!

有人告诉我一些有关服务器上创建Ð服务器上吨的网络服务帐户的Web应用程序使用,并给该帐户的权限或类似的东西,但他不知道的细节无论是。

有一个教程,指导,因为我敢肯定是有办法做到这一点...

此外,所有我能找到谷歌上用FTP但Windows窗体只...

均田坚持在这里...


解决方案

从的这个博客帖子


  

我们可以做以下事项


  
  

      
  1. 使用C#登录的用户帐户

  2.   
  3. 作为模拟登录的用户

  4.   
  5. 复制使用System.IO.File.Copy文件

  6.   

My web applications are on Server D. So I created a web application that has an fileupload control. I can easily upload any file to a folder (FILES) inside the web app.

My question now: How can I upload the same file (from code behind) to a folder (UPLOADS) on a different server (SERVER T) that I have? I also need to read,write and modify that file on the SERVER T. Remember that I use Web Forms and not Windows Forms!!!

Someone told me something about creating a Network Service account on server T for the web app on server D to use and give that account permissions or something like that but he doesn’t know the details either.

Is there a tutorial, guide since I'm sure there is a way to do this…

Also, all I can find on Google is using ftp but for windows forms only…

Kinda stuck around here…

解决方案

Taken from this blog post

We can do following-

  1. Login to a user account using c#
  2. Impersonate as the logged in user
  3. Copy the file using System.IO.File.Copy

这篇关于上传文件到另一台服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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