Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试创建 ajax 文件上传,但是当您上传大于例如:800MB google chrome 崩溃的文件时,我遇到了错误。
所以我想把它切成碎片然后恢复它,但是我该怎么做呢?
您需要使用有助于创建块并将其发送到服务器的 javascript FileReader API。该机制很简单,但是如果您使用的是小块大小,则如果您异步上传,则由于循环遍历所有卡盘,chrome 可能会再次崩溃。
您可以通过使用 Webworkers 来解决这个问题,Javascript Webworkers 充当单独的线程,并在可能的情况下最终使用 Websockets。
很少的资源来实现所有的