如何将巨大(GB)文件上传到网络服务器

发布于 2024-08-27 02:07:05 字数 1436 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

¢蛋碎的人ぎ生 2024-09-03 02:07:05

为此,请使用文件传输协议,而不是 HTTP。您需要一个可以在连接中断时在中间重新启动传输的协议。


顺便说一句,我并不是想使用 FTP。


我不是当前所有文件传输协议的专家(我一直是 FTP 专家,这就是我建议不要使用它的原因)。

然而,在这种情况下,我认为你认为需要透明度的想法是错误的。该系统的所有用户都已在其计算机上安装了 VMWare Converter 软件。我认为他们没有理由不能拥有一个可以进行实际上传的小程序。如果转换器软件有 API,那么您的程序可以自动化整个过程 - 他们会在晚上回家之前运行您的程序,您的程序将转换为 vmdk,然后上传。

具体使用哪种协议,我不知道。这可能需要一些实验。但是,如果协议的使用嵌入在您的小型应用程序和服务中,那么您的用户将不需要知道您正在试验哪些协议。随着您了解更多,您将能够更改它们,特别是如果您以允许自动更新的形式分发您的小程序。

Use a file transfer protocol for this, not HTTP. You need a protocol that can restart the transfer in the middle in case the connection breaks.


BTW, I don't mean to use FTP.


I'm not an expert on all the current file transfer protocols (I've been an FTP expert, which is why I recommend against it).

However, in this situation, I think you're off-base in assuming you need transparency. All the users of this system will already have the VMWare Converter software on their machine. I see no reason they couldn't also have a small program of yours that will do the actual upload. If there's an API to the Converter software, then your program could automate the entire process - they'd run your program before they go home for the night, your program would convert to the vmdk, then upload it.

Exactly which protocol to use, I don't know. That might take some experimentation. However, if the use of the protocol is embedded within your small application and in the service, then your users will not need to know which protocols you're experimenting with. You'll be able to change them as you learn more, especially if you distribute your small program in a form that allows auto-update.

雨后彩虹 2024-09-03 02:07:05

如果您坚持为此使用 Web 界面,那么实现这一目标的唯一方法是使用类似于签名 Java 小程序的东西(我无法谈论 Flash 或其他类似技术,但我确信它们具有类似的功能) )。

一旦您跨越了使用类似小程序的控件的门槛,您就可以更自由地决定做什么以及如何做事情。

HTTP 本身用于上传文件并没有什么问题,只是通用浏览器对于它来说是一个糟糕的客户端(如上所述,不可重新启动只是一个限制)。

但是使用小程序,您可以选择任何您想要的协议,您可以限制上传以免客户端连接饱和,您可以重新启动、发送片段、进行校验和等等。

您不需要专门用于此的整个网页,它可以是一个小组件。它甚至可以是一个不可见的组件(并通过 JS 触发)。但关键因素是它必须是签名组件。未签名的组件无法与用户文件系统交互,因此您需要对该组件进行签名。它可以是您自己的证书等。它遵循与普通网络证书相似的机制。

显然,客户端浏览器也需要支持您的小程序技术。

If you insist on using a web interface for this, the only way to pull it off is with something similar to a signed Java applet (I can't speak to Flash or other similar technologies, but I'm sure they're similarly capable).

Once you've crossed this threshold of going to an applet-like control, then you have far more freedom about what and how you can do things.

There's nothing wrong with HTTP per se for uploading files, it's just that the generic browser is a crummy client for it (no restartability, as mentioned, is but one limitation).

But with an applet you can select any protocol you want, you can throttle uploads so as to not saturate the clients connection, you can restart, send pieces, do checksums, whatever.

You don't need an entire webpage devoted to this, it can be a small component. It can even be an invisible component (and fired via JS). But the key factor is that it has to be a SIGNED component. An unsigned component can't interact with the users file system, so you'll need to get the component signed. It can be your own cert, etc. It follows much of the similar mechanics as normal web certificates.

Obviously the client browser will need to support your applet tech as well.

久夏青 2024-09-03 02:07:05

如果您能找到支持它的主机,Rsync 将是理想的选择。
它可以轻松重新启动,仅重新传输文件中已更改的部分(如果这对您有用),并且具有使用 ssh、压缩等的内置选项。

它还可以确认远程副本与本地文件匹配,而无需传输大量数据

Rsync would be ideal if you can find a host that supports it.
It can restart easily, retransfer only changed parts of a file if that's useful to you and has built in options to use ssh, compression etc.

It can also confirm that the remote copy matches the local file without transferring very much data

苏辞 2024-09-03 02:07:05

我会运行并行 FTP 流来加速该过程......

I would run parallel FTP streams to speed up the process....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文