Skip to content
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

SDcard Write Access #3819

Closed
Auguss82 opened this issue Apr 1, 2019 · 23 comments
Closed

SDcard Write Access #3819

Auguss82 opened this issue Apr 1, 2019 · 23 comments
Labels
bug needs info Waiting for info from user(s). Issues with this label will auto-stale. stale

Comments

@Auguss82
Copy link

Auguss82 commented Apr 1, 2019

Please have nextcloud android client to request write access to sd card. This way for people whom have copious amounts of photos videos on auto upload on charge at night and on wifi will have an empty phone to start a new in the morning. Good for travelers and vacationers.

@nextcloud-android-bot
Copy link
Collaborator

GitMate.io thinks possibly related issues are #802 (Choose any folder on sdcard), #2341 (grant access error), #2155 (App access.), #3044 (Correct handle write protected folders), and #1610 (Adding sdcard prompts immediate backup ).

@ardevd
Copy link
Collaborator

ardevd commented Apr 2, 2019

@Auguss82 not quite sure I follow your reasoning, but at any rate, the Nextcloud app already requests read/write access to external storage.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

@Auguss82
Copy link
Author

Auguss82 commented Apr 2, 2019

When I upload files it says it does not have write access to base directory sd card, so it cannot delete old file on upload. How do I change the setting or get it to reprompt? I already viewed Settings > Apps > Nextcloud > permissions. All selections enabled.

@unix0r
Copy link

unix0r commented Apr 9, 2019

I can confirm this.
My Camera app was writing all photos to the sd card and the auto upload function should move uploaded photos to the app folder.
But for now, the setting for the original file is set to keep in original folder and cant be changed.

Changed the storage of the camera app to the inside memory and the auto upload can be set to move file to app folder.
Something was wrong with the sd card permissions.

@tobiasKaminsky
Copy link
Member

When I upload files it says it does not have write access to base directory sd card, so it cannot delete old file on upload.

This is verified by "canWrite" permission on the specific folder.
I am unsure why the app cannot write onto sdcard for you, but as @ardevd pointed out, we do query for this permission.

@tobiasKaminsky tobiasKaminsky added bug needs info Waiting for info from user(s). Issues with this label will auto-stale. labels Apr 12, 2019
@Auguss82
Copy link
Author

Auguss82 commented Apr 12, 2019

It has write access to the emulated sdcard but not the mounted removable sdcard. You may have to prompt it to locate the sdcard then click select as some apps require to gain write access to the removable storage.

@stale
Copy link

stale bot commented May 23, 2019

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added the stale label May 23, 2019
@Auguss82
Copy link
Author

Any more information that is needed?

@stale stale bot removed the stale label May 23, 2019
@stale
Copy link

stale bot commented Jun 20, 2019

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added the stale label Jun 20, 2019
@Auguss82
Copy link
Author

.

@stale stale bot removed the stale label Jun 23, 2019
@stale
Copy link

stale bot commented Jul 21, 2019

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added the stale label Jul 21, 2019
@tobiasKaminsky
Copy link
Member

@Auguss82 it seems that you are the only one left with this problem.
Which device do you have?
which Android version?

@stale stale bot removed the stale label Jul 22, 2019
@gjanssens
Copy link

Might this be the same issue as #2554 ?
Are the files being uploaded successfully and only the originals not removed ?

@stale
Copy link

stale bot commented Aug 31, 2019

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added the stale label Aug 31, 2019
@Auguss82
Copy link
Author

Auguss82 commented Sep 2, 2019

Samsung LG G6
Android 8.0.0 Build OPR1.170623.032

The problem I am experiencing that the nextcloud app does not request access to external SD that is inserted into the device but read the logical or internal SD card as the external SD card.

So if there is a /media/sdcard, which is the logical or internal SD card, nextcloud app assumes this is the external.

If there is a /media/0000-0000, the numbers vary on speed of read and write of external SD card and manufacturer of external SD card. it does not detect this inserted external SD card as writable media. However the application does have a storage file located on /media/0000-0000/Android/data/com.nextcloud.client when transferring the application to SD card that is writable but he parent folder of /media/0000-0000/* is not writable as the application does not have permission granted by the OS.

Yes I am experiencing the same issue of #2554 and the above reason is why.

@stale stale bot removed the stale label Sep 2, 2019
@stale
Copy link

stale bot commented Sep 30, 2019

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added the stale label Sep 30, 2019
@stale stale bot closed this as completed Oct 14, 2019
@Per0x
Copy link

Per0x commented Jul 4, 2020

Same problem on Samsung Galaxy Edge 7 with Android 8

@wis775
Copy link

wis775 commented Aug 24, 2020

Same problem on Samsung Galaxy A6 with Android 10
Nextcloud Client Version 3.13.0

@llucax
Copy link

llucax commented Jul 28, 2021

Please reopen. I'm experiencing this on Android 11. I also have some folders in the SD card I want to auto-upload and want the uploads to be moved to next loud folder, and the option is grayed out. I have the feeling the first time I installed the app it worked just fine, but I needed to re-format the SD card. I backed-up all files and inserted it again, but now the exfat filesystem has a different serial number. I think android considers this a different SD and because of that it needs to ask for permission again and next loud is not doing this automatically nor providing any option to do it manually.

@llucax
Copy link

llucax commented Jul 28, 2021

I can confirm the above. I just uninstalled Nextcloud and installed it again and now it can write again to the SD card (i.e. move auto-upload files to the Nextcloud folder). Nextcloud app version 3.16.1 (from f-droid).

@Ihi
Copy link

Ihi commented Dec 30, 2021

Same problem - I am unable to set write access for Nextcloud app to "Camera" directory (exactly in my case '/storage/43A4-0AF9/DCIM/Camera'). Uninstalling and reinstalling doesn't help. App doesn't ask for permission (but on the other hand it can use folder on SD card for 'Data storage folder'). Google account is managed via Family link (user under 13, if this somehow matters, but i think it don't).

Phone: Xiaomi Redmi 5A
Android: 8.1.0
Nextcloud app: 3.18.1

@plwww
Copy link

plwww commented Jan 3, 2022

I have the same problem. Moto G7, Android 10, NextCloud version 3.19.0 Alpha1(also tried current Play store version and F-Droid version, whatever those were as of around Dec-27th).

My on-phone storage is presented as /storage/emulated/0/
SD-Card is presented as /storage/A945-0A01/

NextCloud properly detects that /storage/A945-0A01/DCIM/Camera is a media directory, but it is read-only so I cannot select the option to delete after upload. I can select this option for folders stored on-device.

I have verified through the debugger:
it asks for the correct permission WRITE_EXTERNAL_STORAGE when first displaying the FileDisplayActivity, and receives that permission(it is my understanding that without this permission NextCloud also wouldn't be able to delete from on-device shared storage).
In the SyncedFolderPreferencesDialogFragment.checkWritableFolder() method, the call to .canWrite() returns false.
Environment.getExternalStorageDirectory() -> "/storage/emulated/0"
Environment.getStorageDirectory() -> "/storage"

NextCloud can read from "/storage/A945-0A01", so it must be treated as External Storage for read permissions, just not getting write permissions. If there's anything else I can look at, please let me know.

@appiekap653
Copy link

Same problem is still present, Please reopen.
Nextcloud version 3.25.0, Android 10.

Sdcard directory: /storage/34D2-F864/DCIM/Camera

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs info Waiting for info from user(s). Issues with this label will auto-stale. stale
Projects
None yet
Development

No branches or pull requests