有没有办法获得部分上传的文件?

时间:2015-06-25 12:34:21

标签: php apache file-upload

我需要保存上传的文件,即使连接在某些时候失败(如果失败,则保存上传的数量)。 PHP中是否有一种方法可以访问文件的那部分,这是在(例如)与服务器的连接失败之前上传的? (当"5678".foldRight(Seq[String](""))((c, s) => s"$c${s.head}" +: s).dropRight(1) "5678".foldRight(Seq[String]())((c, s) => s"$c${s.headOption.getOrElse("")}" +: s)

时出现UPLOAD_ERR_PARTIAL错误

1 个答案:

答案 0 :(得分:1)

As already suggested in the comments, it's is not worth wasting your time trying to do some magic with PHP. HTML5 already supports chucked file uploads, it would be a much better approach to use some sort of JavaScript library or something else that relies on this technology. I can recommend FlowJS (the demo speaks for itself), but if you don't like it - I am pretty sure there are plenty more around the web with the same functionality.