From e456a325f9dddcd938190daebd0568ed96753ea7 Mon Sep 17 00:00:00 2001 From: Anthony Ward Date: Tue, 27 Feb 2018 12:39:30 +0000 Subject: [PATCH] CB-13923 (android) fix -1 length for compressed files --- framework/src/org/apache/cordova/CordovaResourceApi.java | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/src/org/apache/cordova/CordovaResourceApi.java b/framework/src/org/apache/cordova/CordovaResourceApi.java index e725e255..3c438e21 100644 --- a/framework/src/org/apache/cordova/CordovaResourceApi.java +++ b/framework/src/org/apache/cordova/CordovaResourceApi.java @@ -263,6 +263,7 @@ public class CordovaResourceApi { } catch (FileNotFoundException e) { // Will occur if the file is compressed. inputStream = assetManager.open(assetPath); + length = inputStream.available(); } String mimeType = getMimeTypeFromPath(assetPath); return new OpenForReadResult(uri, inputStream, mimeType, length, assetFd);