apache / apache/cordova-plugin-file
Cannot use copyTo() to write files to a USB
- Dominant language
- JavaScript
- Stars
- 744
- Forks
- 754
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 1
Description
# Bug Report
## Problem
I have written logic where my cordova app copies files and directories from the device to a USB drive, and vice-versa. Both operations work fine on for android devices running the Lollipop OS. That said, while I can copy files from the USB to the device in Pie, I cannot copy files from the USB to pie.
### What is expected to happen?
The app is supposed to copy the file or directory successfully from the device to the USB.
### What does actually happen?
When calling the copyTo() function I get error code 6, which I gather is a permissions error, and the file or directory is not copied.
## Information
From what I can tell, this has to due with enhanced security restrictions introduced by the Pie OS. I was wondering if there was a version of this plugin that enabled you to successfully write to a USB drive, or if there was something I needed in my config.xml or another plugin that would be needed to write to a USB. Thank you for any input.
### Command or Code
It is hard to reproduce unless you have the full app. You would need to use the copyTo() function to copy a file or directory from an existing directory path on the tablet to a directory path of a pluggined-in USB thumb drive.
### Environment, Platform, Device
I am using a Cordova app on a Samsung Galaxy Tab running Android Pie.
### Version information
I am using Cordova CLI tool version 9.0.0.
## Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Contributor guide
Research direction
No source file or test is named. Start at the copyTo() entry point and reproduce the device-to-USB operation on a Samsung Galaxy Tab running Android Pie, comparing it with the working reverse copy and recording error code 6. Done means identifying and resolving the permission failure so a file or directory copies successfully to the USB drive.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, javascript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100