php 文件上传;如何利用“分块”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6375852/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:10:41  来源:igfitidea点击:

File uploads; How to utilize "chunking"?

phpfile-uploadchunking

提问by Andrew

I am (still) attempting to upload large files <200mb via a html form using php.

我(仍在)尝试使用 php 通过 html 表单上传 <200mb 的大文件。

During my research into this I have come across the term "chunking", I understand that this process can break the file into handy sizes such as 5mb and reassemble them into the full file at the server side.

在我对此的研究期间,我遇到了“分块”一词,我知道这个过程可以将文件分解成方便的大小,例如 5mb,然后在服务器端将它们重新组合成完整的文件。

My problem seems to be where I can begin? I seem unable to find the correct resources by googling (Or perhaps I'm suffering from not knowing which terms to search for).

我的问题似乎是我可以从哪里开始?我似乎无法通过谷歌搜索找到正确的资源(或者我可能不知道要搜索哪些术语)。

So what I'm hoping for today is a chance to educate myself with the basics, a direction in which to look would be very helpful. I don't really want to download a plug-in or anything like that, I would prefer to learn by experimentation.

所以我今天希望的是有机会用基础知识来教育自己,看看这个方向会非常有帮助。我真的不想下载插件或类似的东西,我更喜欢通过实验来学习。

EDIT to add: Although the two answers below would appear to be correct, this takes me into the realm of stuff that I can't do as a designer...If anyone reading this can suggest a different approach I would appreciate it.

编辑补充:虽然下面的两个答案似乎是正确的,但这让我进入了我作为设计师无法做的事情的领域......如果有人阅读本文可以提出不同的方法,我将不胜感激。

回答by user703016

Web browsers do not split uploads into chunks. For this you'll have to use your own "chunking" client: a Flash program or a Java applet.

Web 浏览器不会将上传分成块。为此,您必须使用自己的“分块”客户端:Flash 程序或 Java 小程序。

You can take a look at JUpload. There are also examples in the wiki.

你可以看看JUpload。维基上也有例子。

From SourceForge :

Multiple File Upload Applet (JUpload) takes care of the limitation posed by traditional HTML upload forms by allowing you to upload a whole directory and the files within it with a single click. Optionally, it allows simple picture management.

来自 SourceForge :

多文件上传小程序 (JUpload) 解决了传统 HTML 上传表单带来的限制,允许您通过单击上传整个目录及其中的文件。或者,它允许简单的图片管理。