You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2021/09/24 04:36:30 UTC

[cordova-plugin-file-transfer] branch master updated: fix(android): enable download functionality with Android Q (#310)

This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-file-transfer.git


The following commit(s) were added to refs/heads/master by this push:
     new cab8b46  fix(android): enable download functionality with Android Q (#310)
cab8b46 is described below

commit cab8b4607acb6cfd4dfcbbe714677d1feabc8f8a
Author: kpatfln <89...@users.noreply.github.com>
AuthorDate: Fri Sep 24 14:36:25 2021 +1000

    fix(android): enable download functionality with Android Q (#310)
---
 src/android/FileTransfer.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/android/FileTransfer.java b/src/android/FileTransfer.java
index 00bd30f..c2920a8 100644
--- a/src/android/FileTransfer.java
+++ b/src/android/FileTransfer.java
@@ -23,6 +23,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.Closeable;
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
 import java.io.FilterInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -792,7 +793,7 @@ public class FileTransfer extends CordovaPlugin {
                             // write bytes to file
                             byte[] buffer = new byte[MAX_BUFFER_SIZE];
                             int bytesRead = 0;
-                            outputStream = resourceApi.openOutputStream(targetUri);
+                            outputStream = new FileOutputStream(file);
                             while ((bytesRead = inputStream.read(buffer)) > 0) {
                                 outputStream.write(buffer, 0, bytesRead);
                                 // Send a progress event.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org