[Bug] Because of strict type control in M76 Chromium update,
object passed to FormData need to inherit from JS
built-in type - Blob.
[Verification]
tct-file-transfer-cordova-tests 100% (TM1 tizen-unified_20200312.1)
Change-Id: Ib0496113555bee8615e519802e3ce0a9d165b6fa
function successCB(entry) {
if (entry.isFile) {
+ var fullPath = entry.toURL();
entry.file(function(file) {
function uploadFile(blobFile) {
var fd = new FormData();
}
}
- uploadFile(file);
+ var fileHandle;
+ try {
+ fileHandle = tizen.filesystem.openFile(fullPath, 'r');
+ var fileBlob = fileHandle.readBlob();
+ uploadFile(fileBlob);
+ } catch (e) {
+ fail(FileTransferError.ABORT_ERR, 'Could not read file');
+ } finally {
+ if (fileHandle) {
+ fileHandle.close();
+ }
+ }
}, function(error) {
fail(FileTransferError.CONNECTION_ERR);