cordova - 限制相机插件ionic2 cordova中的文件大小?
问题描述
在我的代码中,我尝试从图库上传文件。为此,我使用了相机插件并试图只允许少于 50MB 的文件。从图库浏览时有什么方法可以限制文件大小。下面是我的代码。
this.camera.getPicture({
quality: 50,
destinationType: this.camera.DestinationType.FILE_URI, // <== try THIS
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
mediaType: this.camera.MediaType.VIDEO,
}).then((imageData) => {
}, (err) => {
console.log(err);
});
解决方案
推荐阅读
- c++ - 线程中的成员函数指针
- node.js - 测试时通知中未显示节点 Js 值
- javascript - webpack - 更改 `__webpack_require__` 为每个块存储模块的内部 id 的选项
- c++ - 使用智能指针属性创建一个setter函数?
- node.js - Firebase 管理员:列出所有用户返回空数组
- javascript - 使用 while 循环将整数拆分为数字,然后将数字相乘
- python - 在 python 中使用 selenium 将密钥发送到文本区域不起作用
- c# - cshtml文件没有刷新?
- mysql - SQL 查询是否受所使用的 DBMS 限制?
- vbscript - 在vbscript中除以零