-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cordova Plugin File doesn't work on Android 13 #610
Comments
Access to If you're trying to resolve to the Documents directory, that directory is a standard directory on android, therefore it should be safe to do something like
Now this largely depends on whether your app "owns" the csv file. The short answer is, no permission is needed, or there is no permission available and what you're attempting to do is now impossible with the filesystem. Under scoped storage rules, no permissions are needed to read/write to files that your files owns/created. If the file is owned by another application, then you cannot write to that file using filesystem. Android literally does not support overwriting other apps files directly through the filesystem. Additionally for third-party files, Android only supports reading Images, Videos, and Audio files, but not "Document" files like a CSV file, with the appropriate permissions ( If you wish to write a third-party file, a media store plugin that interfaces with the native Also note that specifically on API 29 (Android 10) Android does not support the external filesystem at all via filesystem APIs. See more details. |
I am using the internal storage. The photo is in the applications cache. so the above is irrelevant. Just want to know what to do to a fileURI that is returned from your photo plugin, in order to get a file entry object getfile(fileURI... no longer excepts it ... it is FILE NOT FOUND . How do I format the returned fileURI to get it in the appropriate format for getfile() operation?? |
In the details provided in your original post, it shows you were using If you're using internal storage then please share the relevant code, or share a sample reproduction app that reproduces your issue. |
Function Mimage_onclick() |
I don't know if there is a language barrier but the code doesn't appear to be at all related to the original issue. First you were asking
Then you're showing camera usage, I don't understand how this relates to the CSV file. This thread has kind of gone off the rails so I'm closing it. I'll say that writing documents to the Documents folder is not possible under android scoped storage system because it forbids write access to file APIs. To do this action, it needs to go through the media store. There are third-party plugins that interfaces with the media store to do this. More info can be found here |
Discussed in apache/cordova#424
Originally posted by leonelgregioauler July 10, 2023
Good morning!
What permission should I add to be able to write a .CSV file in the "Documents" folder ?
I've tried all the permissions below.
I got this error: "onErrorGetDir". The folder is: file:///storage/emulated/0/
Remember, this works fine on others versions, like Android 11 or below. Android 12 I haven't tested yet, but it seems to work !
Thank you for now !
The text was updated successfully, but these errors were encountered: