android icon indicating copy to clipboard operation
android copied to clipboard

Configure download folder (external_sd)

Open mokasin opened this issue 13 years ago • 150 comments
trafficstars

At the moment with version 1.3.12 on Android 2.3.6 the ownCloud client seems to sync with a hardcoded folder at /sdcard/owncloud.

On my phone /sdcard points to the internal memory of the phone, which is quiet small.

Please add an option to set the syncing target directory in the client.

mokasin avatar Nov 04 '12 10:11 mokasin

Thanks for the suggestion.

We will include it to the product backlog.

rperezb avatar Nov 05 '12 07:11 rperezb

Thanks, mokasin. The path is not hardcoded, but it's true we can improve the way it's handled.

Could be helpful that you told us what model is your device.

davivel avatar Nov 05 '12 08:11 davivel

This is a problem on Android side, because we are using getExternalStorageDirectory to get external memory of device. But as you can read in docs " Traditionally this is an SD card" means that it should point to SD card, but it's not mandatory.

przybylski avatar Nov 05 '12 08:11 przybylski

It's a Samsung Galaxy Ace 2 (GT-I8160).

The most obvious way to solve the issue: Just let the user decide in the settings menu what path to use (with a proper presetting). But this most probably occurred to you already ;-).

Thank you very much.

mokasin avatar Nov 05 '12 09:11 mokasin

Same problem,

With >= 4.2.2 is mandatory, becouse android now emulated the memory, and sdcard start to point always to the internal memory of the phone.

ElGranLoky avatar Jul 07 '13 21:07 ElGranLoky

Same request for me (samsung gt-i8160 Android 4.1.2). It would be nice if we have the choice.

guiyou65 avatar Sep 08 '13 21:09 guiyou65

Same here. I still have enough memory on my internal SD-Card of my tablet (Medion Lifetab P9514 with Android 4.0.3) but I definitely want to put the directory on the external SD-Card. On my Android phone (Alcatel One Touch 918D with Android version 2.3.5) I have no chance to use owncloud because the internal memory is very small, but putting the directory onto the external SD-card would solve the problem.

Franz47 avatar Oct 02 '13 15:10 Franz47

If this issue will eventually get resolved then some security problems arises. Because in non rooted phones internal memory in encrypted, which isin't true for external memory. Most of users are not aware of this and might falsely accuse OC of uncarefull data handling, which is a bad thing.

przybylski avatar Oct 02 '13 19:10 przybylski

That's a security flaw in in Android itself. That's hardly addressable by an app.

Best thing, I think, is to point it to the internal memory by default, but give the possibility to choice. That should patronize enough.

mokasin avatar Oct 04 '13 15:10 mokasin

I have a Sony Xperia Z Ultra which also has this problem, where files are stored in /storage/emulated/legacy/owncloud which is local. I need it to use /storage/removable/sdcard1/owncloud instead. I've sadly just hit the point where I can no longer use ownCloud due to this space limitation.

Regarding encryption, I can confirm that my device did give me the option of additionally encrypting the SD card during the encryption stage, which I have done (and verified on a computer that the SD card cannot be mounted). I don't know if that was a Sony thing or a native Android function in newer Android versions, but I agree that it shouldn't be a concern of the ownCloud project either way.

boltronics avatar Jan 02 '14 09:01 boltronics

to bring this issue back on a current Status: this enhancement is still required Samsung Galaxy with required WiFi etc. Features is only available with 16 GB internal Memory - and the users already have got approx. 18 GB of data in ownCloud...

jochenwezel avatar Mar 21 '14 11:03 jochenwezel

Any news on this? This feature would help a lot.

ralf1070 avatar Jun 03 '14 15:06 ralf1070

Nothing new, sorry.

Contributions are welcome.

davivel avatar Jun 04 '14 06:06 davivel

+1 This would be a nice feature, I had to delete the owncloud-data folder because I ran out of memory on the internal memory, after the last automatic upload of pictures. :(

ghost avatar Jun 05 '14 17:06 ghost

@rperezb , @MTRichards , should we consider this for the short / mid term?

davivel avatar Jun 06 '14 12:06 davivel

We have to figure out how to handle this with encrypted data. Probably possible, just more effort as a result. Didn't we discuss this already?

MTRichards avatar Jun 06 '14 14:06 MTRichards

Whats is the actual problem with encrypted data?

If it is the data is unencrypted on sd cards problem - add a simple message: "warning: entered path points to unencrypted storage". So the user can decide ...

ralf1070 avatar Jun 06 '14 14:06 ralf1070

Shouldn't be a problem for encrypted data, provided we implement this feature as a simple relocation of the root folder of the account in the local file system. I wouldn't differentiate several locations where the app makes different things, just allow the user to move the local ownCloud folder to other point.

davivel avatar Jun 09 '14 07:06 davivel

I think that what we discussed the last time was the policy of copying files that are uploaded from the device into the local ownCloud folder.

davivel avatar Jun 09 '14 07:06 davivel

In case it is not automatically there: It might be helpful to persist the changed owncloud location somehow so that after the next owncloud update, it just continues using the changed location

jochenwezel avatar Jun 10 '14 07:06 jochenwezel

This would be a great idea where the user gets the option to either use their sd card or internal memory. And if we get a popup message when we select the sd card that the card storage might not be encrypted and its the user responsability to ensure that encryption is enabled would get OC off the hook. I have a samsung S4 ad i had to do a factory reset as OC filled it up after a while. So this feature would be the best solution.

Hope it can be done soon as this conversation started over a year ago.

Cheers,

Raj

rajbps avatar Aug 04 '14 09:08 rajbps

+1

bcu8heq2 avatar Sep 06 '14 16:09 bcu8heq2

I believe the user should be allowed to sync more than one folder, not matter where it is. I would like to use Owncloud to backup data from my phone which is at different places.

markum avatar Sep 07 '14 13:09 markum

To be honest - as a first step it would very much help if it would be possible to at least change the current root folder. To have more folders available could be interesting, but - at least for me - is a minor add on.

ralf1070 avatar Sep 08 '14 06:09 ralf1070

Im waiting so long now for this, please please implement. But mind the new write restrictions coming with kitkat on external_sd: whole external_sd is read-only except the following:

  1. System apps like the stock samsung file manager
  2. Per app private home-directory located in: external_sd/Android/data/...
  3. Rooted devices with removed restrictions

Suggestion: 2 radio buttons for internal sd & external sd plus path-entry-box which in case external sd is chosen and write restrictions are present is inactive and preset with private home path, else user can enter any path.

Please,please

fajabird avatar Sep 19 '14 13:09 fajabird

@fajabird , thanks for the notice. Yes, the restrictions on external storage access are very important from Android 4.4.

Unfortunately, I still cannot say when this feature will be added. Contributions are welcome.

davivel avatar Sep 23 '14 13:09 davivel

+1

Because of storage shortage I need to store files on the external SD card. But this is really a problem for Android >=4.4, because of the newly introduced Android RW limitation.

As a workaround change the logic for the storage path in FileStorageUtils.java. For me this works on a Samsung Galaxy Note 10.1 2014.

The following patch places all Owncloud downloads on the external SD card in the application data folder in /storage/extSdCard/Android/data/com.owncloud.android/files/

Patch for utils/FileStorageUtils.java:

22,26d21
< import com.owncloud.android.MainApp;
< import com.owncloud.android.R;
< import com.owncloud.android.datamodel.OCFile;
< import com.owncloud.android.lib.resources.files.RemoteFile;
<
32a28,32
> import com.owncloud.android.MainApp;
> import com.owncloud.android.R;
> import com.owncloud.android.datamodel.OCFile;
> import com.owncloud.android.lib.resources.files.RemoteFile;
>
40c40,53
<     //private static final String LOG_TAG = "FileStorageUtils";
---
>     //private static final String TAG = FileStorageUtils.class.getSimpleName();
>
>
>     @SuppressLint("NewApi")
>       private static final File getBaseStorePath() {
>         File baseStoragePath = Environment.getExternalStorageDirectory();
>         if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
>             File[] dirs = MainApp.mContext.getExternalFilesDirs(null);
>             if (dirs.length > 1) {
>                 baseStoragePath = dirs[1];
>             }
>         }
>         return baseStoragePath;
>     }
43,44c56,57
<         File sdCard = Environment.getExternalStorageDirectory();
<         return sdCard.getAbsolutePath() + "/" + MainApp.getDataFolder() + "/" + Uri.encode(accountName, "@");
---
>         //File sdCard = Environment.getExternalStorageDirectory();
>         //return sdCard.getAbsolutePath() + "/" + MainApp.getDataFolder() + "/" + Uri.encode(accountName, "@");
45a59
>         return getBaseStorePath().getAbsolutePath()  + "/" + Uri.encode(accountName, "@");
53,54c67,68
<         File sdCard = Environment.getExternalStorageDirectory();
<         return sdCard.getAbsolutePath() + "/" + MainApp.getDataFolder() + "/tmp/" + Uri.encode(accountName, "@");
---
>         //File sdCard = Environment.getExternalStorageDirectory();
>         //return sdCard.getAbsolutePath() + "/" + MainApp.getDataFolder() + "/tmp/" + Uri.encode(accountName, "@");
55a70
>         return getBaseStorePath().getAbsolutePath() + "/tmp/" + Uri.encode(accountName, "@");
60c75
<         File savePath = Environment.getExternalStorageDirectory();
---
>         File savePath = getBaseStorePath();
68d82
<
´´´

Ixtalo avatar Nov 21 '14 08:11 Ixtalo

Is there any behaviour decided on what to do with existing files? Is there any path stored in the database?

Kernald avatar Jan 12 '15 15:01 Kernald

@Kernald, paths are stored in database for every file with local copy, and probably should remain that way, since we want to change the current behaviour in uploads and stop duplicating files - what means keeping a full path at least for the uploaded files.

This issue is considered in our roadmap, but without no estimated time to implement it. In few words: we need to change the implementation of FileStorageUtils.getSavePath() so that the current base sdCard.getAbsolutePath() + "/" + MainApp.getDataFolder() + "/" is changed with a value previously saved in the app settings. Its default value should match sdCard.getAbsolutePath() + "/" + MainApp.getDataFolder() + "/". The paths of the local files, although saved in the database, are generated from this method.

Then we would need adding an entry in the Settings activity to allow the users change the value saved in settings. Changing the value would require ** moving ** the current folder to the new location, what may result in errors to condider, of course.

davivel avatar Jan 16 '15 13:01 davivel

Okay, thanks. Moving files involve updating the database entries, hence my question.

Kernald avatar Jan 16 '15 13:01 Kernald