{"bugs":{"url":"https://github.com/raxjs/universal-api/issues"},"dist":{"shasum":"029fc0814534176cadb647ec7ecb54a55b34de2a","tarball":"https://registry.npmjs.org/@uni/file/-/file-1.0.8-beta.tgz","fileCount":136,"integrity":"sha512-iQM54SBzVWug+dd+isEXQe3yIYhftIjd28YOE6axJP5NdylGRqs338QrjRzfPMI35uaGY0aEt7mYxeGBhPqQ4w==","signatures":[{"sig":"MEUCIQCLYmPIsGf+srdMYeEaT6XyQwfBuYFDqNs9p5PMfdo0nwIgBADXmGiXCg4LpwxjUPFuiwQwBzqIFRdxwNh1+ShjsHY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":193274,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpMPECRA9TVsSAnZWagAAcxEP/3P8CWeFPx5vkpOvLS9S\nKf5cqpaz4CJIZLNF3HCIUqeCh+naxF0G+PiAxuFa7ewBQIxjMQrhhlo4pEBd\nDazFAAEPaxr5MH1SMZn7U7DXpu3B76/6rngX4tFSZu/m8GH9o9XI43ayrI+Z\n5fzuM968TXVVDlUaOgkCM7AP37BfyfrtFCaC+WfD4Diq+ru0AMZy8t4ckUUw\n3EpCYTIN5et9CiWAFEmB2q4gOabxYf33ROLz/S92qMw5LrEE2Z3pdbLgtrmb\nhUwvVxBJYYjwIg3sXqDOMe66/jIWzR6Z92zLoijaPSF2w6/KCm8mn+J9IRBq\n5ysS/RQaqlhsVNgOEnKjcflS9TiiLFOVT6jdaB435PQBil5YjMYg15widg5G\nv/9msuekEbyBexELzAOanOgg7sRe5clSZ7WeUc9onx3HxIPcvbTMqpZSJ2PP\n0srMhL/S/sesFynJMsLO2SVRmU5UdXYdc3kmxq7f0Du2SG8qUPYeppaBr5nV\nSSUdB9fqRC/891xbNEPN+U0VirEFrg7RGqR0nB5ZFcK5Tr0M8jrNbq1rAA5c\nkvW7Z2x7uzRWy2JrESEIdDc6lxn6HbywQ2lGuKXc/37smetbUL9BYC4AJNsu\noco/Kjqy2rvHLluVKaV87225ysQeuBlKZYGQpnSrxU7d5De2Rvy5eD++FqVW\n1AgC\r\n=pVn+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"@uni/file","unpkg":"dist/index.js","author":{"name":"rax"},"module":"es/index.js","readme":"# file\n[![npm](https://img.shields.io/npm/v/@uni/file.svg)](https://www.npmjs.com/package/@uni/file)\n\nFile operations.\n\n## Support\n<img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\">\n\n## Install\n\n```bash\n$ npm install @uni/file --save\n```\n\n## Methods\n\n### `getInfo(options)`\n\nGet file information.\n\n#### Support\n<img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\">\n\n#### Parameters\n| Property        | Type     | Default | Required | Description                                                  | Support                                 |\n| --------------- | -------- | ------- | -------- | ------------------------------------------------------------ | --------------------------------------- |\n| filePath        | `String` |         | √        | The file path                                                | <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n| digestAlgorithm | `String` | md5   | x        | The algorithm to calculate the file summary can be md5, sha1 | <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n\n\n### `getSavedInfo(options)`\n\nGets saved file information.\n\n#### Support\n<img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\">\n\n#### Parameters\n| Property | Type     | Default | Required | Description   | Support                                 |\n| -------- | -------- | ------- | -------- | ------------- | --------------------------------------- |\n| filePath | `String` |         | √        | The file path | <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n\n### `getSavedList(options)`\n\nGets all saved file information.\n\n#### Support\n<img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\">\n\n### `openDocument(options)`\n\nOpen a file preview on the new page.\n\n#### Support\n<img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\">\n\n#### Parameters\n| Property | Type     | Default | Required | Description   | Support                                 |\n| -------- | -------- | ------- | -------- | ------------- | --------------------------------------- |\n| filePath | `String` |         | √        | The file path | <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n| fileType | `String` |         | x        | The file Type | <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n\n### `removeSaved(options)`\n\nDelete a saved file.\n\n#### Support\n<img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\">\n\n#### Parameters\n| Property | Type     | Default | Required | Description   | Support                                 |\n| -------- | -------- | ------- | -------- | ------------- | --------------------------------------- |\n| filePath | `String` |         | √        | The file path | <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n\n### `save(options)`\n\nSave the file locally.\n\n#### Support\n<img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\">\n\n#### Parameters\n| Property | Type     | Default | Required | Description   | Support                                 |\n| -------- | -------- | ------- | -------- | ------------- | --------------------------------------- |\n| filePath | `String` |         | √        | The file path | <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n\n### `upload(options)`\n\nUpload local resources to the developer server.\n\n#### Support\n<img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\">\n\n#### Parameters\n| Property | Type     | Default | Required | Description                          | Support                                 |\n| -------- | -------- | ------- | -------- | ------------------------------------ | --------------------------------------- |\n| url      | `String` |         | √        | Developer server address             | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n| filePath | `String | File Object` |         | √        | The path to upload the file resource. In web browser, it can be ei\bther base64 string or a File object. | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n| fileName | `String` |         | √        | File name, that is, the corresponding key, the developer in the server side through this key can get the binary content of the file.             | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n| fileType | `String` |         | √        | File type supports image, video, audio (image/video/audio). Not required in browser. | <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n| header | `Object` |         | x        | The HTTP request Header | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n| formData | `Object` |         | x        | Additional form data in the HTTP request | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n| withCredentials | `Boolean` |   | x    | Custom `withCredentials` option  | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"h5\" />  |\n| timeout | `Number` |  | x    | Upload timeout  | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" title=\"h5\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n\n#### Return\nNotice: Notice: Alipay applet only supports client 10.1.35 and above. Please use it with caution because it will destroy one code with multiple platforms. When using it, please make sure that it is not empty, and the `upload` will return empty under containers that do not support UploadTask.. Please use it with caution because it will destroy one code with multiple platforms. When using it, please make sure that it is not empty, and the `upload` will return empty under containers that do not support UploadTask.\n\n**UploadTask**\n\nAn object that can monitor upload progress change events and cancel upload tasks. Specific documents can be viewed:\n* WeChat: [Link](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.html)\n* ByteDance: [Link](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/network/http/upload-task/)\n* Alipay: Same as WeChat, but missing `onHeadersReceived` and `offHeadersReceived`.\n* Web: Same as WeChat\n\n\n### `download(options)`\n\nDownload file resources locally.\n\n#### Support\n<img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\">\n\n#### Parameters\n| Property | Type     | Default | Required | Description             | Support                                 |\n| -------- | -------- | ------- | -------- | ----------------------- | --------------------------------------- |\n| url      | `String` |         | √        | Download file address   | <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n| header   | `Object` |         | x        | The HTTP request Header | <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> <img alt=\"bytedanceMicroApp\" src=\"https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg\" width=\"25px\" height=\"25px\"> |\n\n#### Return\n注意：只有微信小程序和字节跳动小程序支持\n\nDownloadTask\n一个可以监听下载进度变化事件和取消下载的对象\n具体文档可以查看：\n微信：https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.html\n字节跳动：https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/network/http/download-task/\n\n## Example\n\n```js\nimport { download, getInfo, getSavedInfo, getSavedList, openDocument, removeSaved, save, upload } from '@uni/file';\n\n// Get file information.\ngetInfo({\n  filePath: 'https://resource/apml953bb093ebd2834530196f50a4413a87.video',\n  digestAlgorithm: 'sha1',\n  success: (res)=>{\n    console.log(JSON.stringify(res))\n  }\n});\n\n// You need to save the address to be able to use File.getsavedinfo\ngetSavedInfo({\n  filePath: '**filePath**',\n  success: (res) => {\n    console.log(res.size);\n    console.log(res.createTime);\n  }\n});\n\ngetSavedList({\n  success:(res) => {\n    console.log(JSON.stringfy(res));\n  }\n});\n\nopenDocument({\n  filePath: '**filePath**',\n  fileType: 'pdf',\n  success: (res) => {\n    console.log('open document success');\n  };\n});\n\nremoveSaved({\n  filePath: '**filePath**',\n  success:(res) => {\n    console.log('remove success');\n  }\n});\n\nsave({\n  filePath: '**filePath**',\n  success:(res) => {\n    console.log('save success');\n  }\n});\n\nupload({\n  url: 'http://httpbin.org/post',\n  fileType: 'image',\n  fileName: 'file',\n  filePath: '**filePath**',\n  success: res => {\n    console.log('upload success');\n  },\n  fail: res => {\n    console.log('upload succefailss');\n  },\n});\n\ndownload({\n  url: 'http://img.alicdn.com/tfs/TB1x669SXXXXXbdaFXXXXXXXXXX-520-280.jpg',\n  success: res => {\n    console.log(res.filePath);\n  },\n  fail: res => {\n    console.log(res);\n  },\n});\n\n```\n\n","exports":{".":{"web":"./es/web/index.js","default":"./es/index.js","miniapp":"./es/ali-miniapp/index.js","bytedance-microapp":"./es/bytedance-microapp/index.js","wechat-miniprogram":"./es/wechat-miniprogram/index.js"},"./*":"./*"},"license":"BSD-3-Clause","typings":"types/index.d.ts","_npmUser":{"name":"bunko","email":"2leg@immaster.cn"},"homepage":"https://github.com/raxjs/universal-api#readme","repository":{"url":"git+ssh://git@github.com/raxjs/universal-api.git","type":"git"},"_npmVersion":"6.14.5","description":"[![npm](https://img.shields.io/npm/v/@uni/file.svg)](https://www.npmjs.com/package/@uni/file)","directories":{},"maintainers":[{"name":"rax-publisher","email":"rax-public@alibaba-inc.com"},{"name":"bunko","email":"2leg@immaster.cn"}],"sideEffects":false,"_nodeVersion":"14.4.0","dependencies":{"@uni/env":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.en-US.md","_npmOperationalInternal":{"tmp":"tmp/file_1.0.8-beta_1621410755942_0.59497695463067","host":"s3://npm-registry-packages"},"_id":"@uni/file@1.0.8-beta","version":"1.0.8-beta"}