- 28
- 0
有人知道上面这个请求访问沙盒函数中的size的大小限制吗?我的需求是想实现一个web版的文件管理系统,主要功能是实现大文件的切割上传以及断点续传功能。下载过程的断点续传的思想是,下载某个文件前,先读取本地的缓存文件夹,判断是否已有该文件,若已有该文件则获取该文件的内容,然后仅需要将该文件没有的部分内容下载并写入到该文件即可,主要采用了file.slice()函数。因为JS无法操控本地文件,但FileSystem API有沙盒文件可提供给用户操作,所以我的思想就是将沙盒做为那个文件目录,每次请求文件前请求该沙盒,判断该沙盒中是否有要下载的文件(因为沙盒中有FileReader和Filewriter可以用来操作文件实现断点续传,其实此处并没有将文件下载到用户的操作系统目录),现在的问题是不知道请求沙盒分配空间时(即调用window.requestFileSystem(type, size, successCallback[, errorCallback]);),其中的size有没有大小限制,大概是多少,因为我这个系统主要是用来处理大文件的,不知道沙盒有没有大小限制。
FileSystem中沙盒的操作可见https://github.com/guangying1...
- 共 0 条
- 全部回答
-
其实喜欢你 普通会员 1楼
requestFileSystemis a method of thewindowobject that allows you to access and manipulate the file system on your device. It takes three arguments:type: specifies the type of file system you want to access. In this case,typeis set to'read-only'which means that only read access is allowed to the file system.size: specifies the size of the file system in bytes. This argument is optional.successCallback: is a function that is called when the request is successful. The function takes one argument, which is a promise that will resolve to the result of the request. In this case, thesuccessCallbackfunction should return a promise that resolves to the result of the request.
Here is an example of how you might use
requestFileSystem:javascript requestFileSystem('read-only', 1000000, function(error, fileSystem) { if (error) { console.error(error); } else { console.log(fileSystem.root); } });In this example, we're requesting a file system with type
'read-only', a size of 1000000 bytes, and a callback function that will be called when the request is successful. If there is an error, we'll log it to the console. If the request is successful, we'll log the root directory of the file system to the console.
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部
