You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2021/09/14 04:08:56 UTC

[GitHub] [cordova-plugin-file-transfer] kpatfln commented on a change in pull request #310: [Android] Enable using MediaStore API on Android Q

kpatfln commented on a change in pull request #310:
URL: https://github.com/apache/cordova-plugin-file-transfer/pull/310#discussion_r707893214



##########
File path: src/android/FileTransfer.java
##########
@@ -792,7 +796,24 @@ public void run() {
                             // write bytes to file
                             byte[] buffer = new byte[MAX_BUFFER_SIZE];
                             int bytesRead = 0;
-                            outputStream = resourceApi.openOutputStream(targetUri);
+                            /* 
+                                This ensures that for Android Q and above that the new MediaStore API being used.
+
+                                Instead of using the provided target directory for saving from the web app, it will automatically
+                                save to the Downloads folder.
+                            */
+                            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {

Review comment:
       Thanks for your advice!
   
   I agree that the limitation of just throwing it into the Downloads folder mightn't be the best idea.
   
   Let me give it a try with `cordova-plugin-file` and get back to you with the PR there.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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