mirror of
https://github.com/apache/cordova-plugin-file-transfer.git
synced 2024-10-06 07:42:20 +08:00
fix(android): enable download functionality with Android Q (#310)
This commit is contained in:
parent
2ce746e045
commit
cab8b4607a
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user