拆分文件以通过php上传 [英] splitting a file for upload via php
问题描述
在php.ini和nginx配置中,可以设置一些限制,这些限制限制了一个请求可以包含的总大小.例如1mb.
in php.ini and nginx configurations, there are limits that can be set which restrict the total amount of size a request can contain. 1mb for example.
因此有这个要求,如果用户要上传一个10mb的文件,我想将该文件拆分为1mb的块并将其发送到多个后端应用程序服务器,这些服务器都使用共享存储.从这里开始,我希望能够合并这些块或将它们重新组装回最终的10mb文件.
so with that requirement, if a user wants to upload a file that is 10mb , i want to split the file into 1mb chunks and send it to multiple backend application servers where they all use shared storage. from here, i want to be able to merge the chunks or re-assemble them back to the final 10mb file.
-
PHP前端/后端有可能吗?我有一个支持POST的REST API,它将检查$ _FILE []的所有发布请求-我不确定如何在后端进行管理
is this possible with PHP front end / back end? I have a REST API which supports POST and will inspect all post requests for $_FILE[] -- I'm unsure how this could be managed on the backend
在前端,当用户点击Submit时,文件开始上传...这意味着,如果它是10mb ...它将失败-所以,这是否意味着我需要一些漂亮的javascript进行分块/表单提交-如果是这样,那么如何进行结构化/通信,以便后端知道该怎么做...
on the front end, when a user hits submit, the file starts to upload ... which means, if it's 10mb ... it'll fail -- SO, does this mean i need some fancy javascript to do the chunking / form submission -- if so, how is that then structured / communicated so that the backend knows what to do ...
推荐答案
对于Javascript或PHP,这是不可能的.也许使用Flash或其他客户端技术.
This won't be possible with Javascript or PHP. Maybe with Flash or some other client technology.
这篇关于拆分文件以通过php上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!