0

Simple question, but I couldn t find the answer anywhere (all answers requires rooting on android marshmallow because ftp clients doesn t include the permission to write on the sdcard). I have a huge file which is too large to be downloaded on internal storage. So it can only be downloaded on the sdcard directly. It also seems no ternal apps have the permission to write to the sdcard so I cannot use command line tools directly.

As the file is huge, I also need to be able to pause and resume downloads.

user2284570
  • 459
  • 1
  • 9
  • 26

1 Answers1

-1

I use Folder Sync.
But it depends on your android version, If you have 5.1 or above then the application developers must include Environment.getExternalStorage.....

EXAMPLE FILE USAGE

File file = new File(Environment.getExternalStorageDirectory(), "myfile.txt"); 

instead of the old hard coded way.

File file = new File("SDCard", "myfile.txt"); 

For more information about pause resume with FTP, i have included a link to a development question regarding pause resume on Android Clients

Folder Sync Free

Developing FTP Client with Pause Resume on Android

For terminal emulator, you should run

getprop vold.path.external_sd

then try running the external directory as returned

NOT

sdcard/download/txt.txt

RATHER

storage/sdcard0/download/txt.txt

It's usually just one directory / legacy directory isn't accessible anymore. so you need to get the actual path with some command...

getprop  

getprop will return all current system properties, this includes storage paths and network status results

Empire of E
  • 1,590
  • 1
  • 8
  • 11
  • So I need to use root for your app. but I am waiting the android 7 feature for that. – user2284570 Sep 29 '17 at 06:45
  • You shouldn't ever need root access to access the SD Card unless the Application uses an old hard coded SD Card Path .... I know that you can do a folder pick, then click Show SD Card, Then select the folder on SD Card to save to... It shouldn't be called SD Card, but something like E4-534/download/path instead of SDCard/download/path.... This doesn't need root access just the correct coding – Empire of E Sep 30 '17 at 00:36
  • It doesn’t seems to support download pausing and resuming. I’ve only part time Internet access. – user2284570 Sep 30 '17 at 00:40
  • Ok, how big is the file ? .. I'm not sure about pause resume capability on most FTP Servers because of low security with raw data being sent, username, password etc... – Empire of E Sep 30 '17 at 00:46
  • You can pause and resume anytime with wget or aria2 on ftp servers (the connection is closed and on reopening the download starts with an offset). It’s 30ɢb large but as an xml file, it’s size can eventually be reduced before downloading.. – user2284570 Sep 30 '17 at 00:47
  • It might be a client issue with android applications... here's the link i read https://stackoverflow.com/questions/32536854/android-ftp-download-pause-resume – Empire of E Sep 30 '17 at 01:00
  • wget and aria2c are Linux commands that requires a terminal emulator on Android. I saw no terminal emulator allowing to write to sd card. – user2284570 Sep 30 '17 at 01:02
  • It'd actually be pretty simple to make according to the previous link, but it'd take me half a day ! – Empire of E Sep 30 '17 at 01:05
  • Terminal commands can be run with process and input stream then you could pull the sdcard encrypted directory name E4-686/ and then run a string command stringing together the directory with command to be run via process, then capture the input stream and return it back to user ! – Empire of E Sep 30 '17 at 01:08
  • what ??? ??? ??? – user2284570 Sep 30 '17 at 10:48