创建客户端pc和远程frp服务器之间的直接连接
大家好。
我正在开发一个 Asp.Net Web 应用程序,我必须在其中实现文件上传,但有一点复杂:
为了更好地解释,该应用程序在服务器“A”上运行..文件需要上传到完全不同的服务器“B”。
一旦客户端“C”通过站点界面上传文件,该文件实际上必须上传到服务器B。
从技术上讲,我已经实现了这一点:
- 客户端选择他想要上传的文件从他的电脑上,然后 单击“上传”
- 在页面回发期间
- ,服务器上传文件而不保存它我从 FileUploas 控件中获取 fileStream 并通过 ftp 将其发送到服务器“B”;
但是,通过这样做,实际上该文件是传输了两次(C -> A -> B),使得文件上传的用户体验比正常情况下更长。
我的问题是:是否可以通过以下方式在“C”和“B”之间打开“直接”连接网站界面(在服务器“A”上运行),为了执行单次传输?显然,我应该能够在下载期间执行相同的操作。
另一种选择(至少在上传期间)应该是“隐藏”双重传输通过在服务器“A”上保存临时文件,然后将其重新传输到“B”以启动单独的任务,以便用户在“第一次”上传后能够在网站上执行新操作。
非常感谢任何建议(即使是完全不同的解决方案,我也会评估与我的项目的“兼容性”)
提前谢谢您,
Alberto
注意:我选择使用 FTP,因为客户必须能够选择他想要的位置要放置的“B”服务器(他可以使用“我们的”ftp,或者,如果他有的话,向那里发送文件),我认为 FTP 是最“兼容”和“快速设置”的解决方案,ftp 类似地独立管理到服务器“B”平台。
Good day to everyone..
I'm devoloping an Asp.Net Web Application in which I have to implement file upload, but with a little complication:
To better explain, the application is running on server "A".. the files need to be uploaded to a completely distinct server "B"..
Once the client "C" uploads a file through the site interface, the file must actually be uploaded to server B.
Technically I already achieved this:
- client choses the file he wants to upload from his pc, then click "upload"
- during the postBack of the page", the server upoloads the file without saving it
- I pick up the fileStream from the FileUploas control and send it via ftp to server "B";
BUT, by doing this, actually the file is transferred twice (C -> A -> B), making the user experience of the file upload longer than normal..
My question is: is it possible to open a "direct" connection between "C" and "B" through the site interface (running on server "A"), in order to perform a single transfer? Obviously, I should be able to do the same thing during download..
An alternative (at least during upload) should be that of "hiding" the double transfer by saving a temp file on server "A", and then re-transfer it to "B" starting a separated task, so that the user will be able to perform new actions on the site after the "first" upload.
Any suggestion is greatly appreciated (even quite different solutions, I'll then evaluate the "compatibility" with my project)
Thank you in advance,
Alberto
Note: I choose to go for FTP because the client must be able to select where he want the "B" server to be placed (he can use "our" ftp or, if he has one, send files there) and I think that FTP is the most "compatible" and "fast set up" solution, being ftp managed similarly independently to the server "B" platform.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前还不清楚您期望 C 能够建立什么样的连接。如果 C 可以打开到 B 的直接连接,并且服务器 A 具有访问 B 的凭据,则场景如下所示:
上述内容要求您了解 FTP 协议的详细信息,并且很可能自己将其实现为客户端和服务器。这可能非常耗时。
It's not clear, what kind of connection you expect from C to be capable of making. If C can open direct connection to B, and if the server A has credentials for accessing B, the scenario can look as follows:
The above requires that you know details of FTP protocol and most likely implement it yourself as both client and server. And this can be quite time-consuming.