How to create a file blob for use with Fine Uploader api

给你一囗甜甜゛ 提交于 2019-12-25 02:53:58

问题


I'm using the cordova-imagePicker to get a local URL on Android and I'm uploading it with the cordova-file-transfer plugin. I would like to switch to Fine Uploader so I can make use of the resumable feature but the only api method I can find takes a file blob. How do I create a suitable blob given the path to a file or is there an api in Fine Uploader that will take a path?


回答1:


The only way to programmatically add files to Fine Uploader via the API is the addFiles() function. It allows you to add Files, <input>s, Blobs, BlobWrapper objects, <canvas>es, or CanvasWrappers.

There is no way in HTML5, currently, to create a reference to a file from a path on the local file system. My suggestion is to search for ways to create an HTML5 File object (or another compatible addFiles parameter) in Cordova/Phone Gap. Sorry, but I have 0 experience with those.

The FileEntry.file property seems promising.



来源:https://stackoverflow.com/questions/30067282/how-to-create-a-file-blob-for-use-with-fine-uploader-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!