How read/write file in sdcard using PhoneGap?

John Henrique

I trying write/read file on sdcard using PhoneGap. Reading Android File System I test cordova.file.dataDirectory, cordova.file.externalApplicationStorageDirectory, cordova.file.externalRootDirectory but this give me access to:

  1. file:///data/user/0//files
  2. file:///storage/emulated/0/Android/data/
  3. file:///storage/emulated/0/

The question, I can read/write this directories but I need leave this file public, out of sandbox.

So, any idea about how do this?

DaveAlden

Since Android 4.4, apps are restricted to read-only access outside of their sandbox. The only place the app has write access to is within its sandboxed areas:

  • in /data/ area, e.g. file:///data/data/your.app.id/
  • in internal /sdcard area, e.g. file:///storage/emulated/0/Android/data/your.app.id/
  • in external SD card area (if present) e.g. file:///storage/emulated/1/Android/data/your.app.id/ - note: this is not accessible via cordova-plugin-file

It is not possible for an app to write to other locations outside of these sandboxed areas.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to create and write to a file on sdcard with linux?

Writing a file to sdcard

How to download files (pdf, doc etc...) into sdcard and open the file using volley in android?

How do make make subroutine parameter as readwrite

How to keep on appending logs while writing into File in SDCard?

How to download and save a file using phonegap/cordova on Android

How to remount a read-only folder as readWrite?

How to connect to the server in android development using Phonegap?

How to remove audio file from SDCard by getting it's position

How to add resources file to my phonegap project

How to make an immutable readonly property in the header file (.h), a mutable readwrite property in implementaion (.m)

play music in sdcard if exist file

Phonegap:Get the file from sdcard and upload it to the FTP Server in android

How to access sdcard :

File name is changed when using allowEdit in phonegap

How to get the absolute path of a file stored in Sdcard - Android

unzip file in android using phonegap

android read file from sdcard

Unzip a file from SDcard

How to write/read a txt file from sdcard in Unity?

How to find the right file path in sdcard?

Upload audio file to server on iOS using PhoneGap

How to test if file exists on an SDCard?

how to get list of folders of phone's sdcard(External Memory Card) in phonegap

Phonegap downloaded image on sdcard

Get content URI of images stored on sdcard using File Provider

How to access java file which resides inside SDCard in Android

How to parse json from file in sdcard

Microsoft App Registration - how to create meetings using OnlineMeetings.ReadWrite.All within an application context and not a user context?