You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by "rolinger (via GitHub)" <gi...@apache.org> on 2023/09/01 13:53:56 UTC

[GitHub] [cordova-plugin-file-transfer] rolinger commented on issue #367: Getting code 1 file exists on file download

rolinger commented on issue #367:
URL: https://github.com/apache/cordova-plugin-file-transfer/issues/367#issuecomment-1702786502

   @breautek - final update on this one.  On Android, I got everything working on compiledSDK/targetSDK 33.  
   
   1.  Download file to custom `/MyApp/sub-folder1/` path in the users standard `/Download` folder - IE:  `/Download/MyApp/sub-folder1/thisFile.pdg`
   2. Got around issue if user manually deleted file from `/Download/MyApp/sub-folder1/` by triggering off of native Android error of `EEXIST`.  If that error is detected, then redownload the same file and save to target with a different name (add a character `1`) to the end of the filename.  This gets around the Android scoping issue without having to get into complex user permissions or related issues.
   3. Finally, using `cordova-plugin-file-opener2`, I can display an `open file` button in my app that will auto-launch a app picker for the user to select which app to use to open the file with.  In THOSE apps, they ask for permission access to files downloaded by my app.  The user needs to authorize my access to my app files and all is good.  The same process happens if the user navigates their devices `File Manager` to my app folders and tries to open a file - they select the app, and if permissions not yet granted those apps will walk user through granting access.
   
   Now...just need to validate all this on iOS.


-- 
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