上传文件到另一台服务器

编程入门 行业动态 更新时间:2024-10-26 11:13:04
本文介绍了上传文件到另一台服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

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

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

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

均田坚持在这里...

解决方案

从的这个博客帖子

  

我们可以做以下事项

      
  • 使用C#登录的用户帐户
  •   
  • 作为模拟登录的用户
  •   
  • 复制使用System.IO.File.Copy文件
  •   

    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-

  • Login to a user account using c#
  • Impersonate as the logged in user
  • Copy the file using System.IO.File.Copy
  • 更多推荐

    上传文件到另一台服务器

    本文发布于:2023-10-09 18:47:20,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1476483.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:上传文件   另一台   服务器

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!