4

I have downloaded a file into the folder "dataDirectory". The document exists and its path is something like:

file:///data/data/app_id/files/file_name.pdf 

so, when I'm trying to open it with cordova-open after selecting acrobat reader I recive an error "Not valid path".

localFile = "file:///data/data/app_id/files/file_name.pdf"
cordova.plugins.disusered.open(localFile, function(){}, function({});

It could be a permissions problem?

Solution: using cordova.file.externalDataDirectory it works!

1 Answer 1

3

/data/data/<package>/ is basically an internal storage and only the app for which it has been created has access for it. You will either need to use the external storage to share the file among other apps or you can implement the File Sharing feature .

http://developer.android.com/training/secure-file-sharing/setup-sharing.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.