Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Filesystem copy method - read the full filepath in the "from" property #251

Closed
dotNetkow opened this issue Dec 12, 2020 · 2 comments
Closed

Comments

@dotNetkow
Copy link

Feature Request

Related to ionic-team/capacitor#3940, but thought it worth splitting into two issues.

Description

The Filesystem plugin could read the full filepath in the from property - no directory prop needed.

My use case is moving a photo taken with the official Camera plugin (stored in temp storage, "cache" folder) to permanent storage (data directory).

Here's an example:

// photoFilename = file:///data/user/0/io.ionic.pg.ng.cap/cache/JPEG_20201211_140602.jpg
const savedFile = await Filesystem.copy({
   from: photoFilename,  
   directory: FilesystemDirectory.Cache,  // remove this
    to: "newPhoto.jpg",
    toDirectory: FilesystemDirectory.Data
});

Platform(s)

web, ios, android

Preferred Solution

const savedFile = await Filesystem.copy({
   from: photoFilename,  // directory prop removed, Capacitor parses filename for us
    to: "newPhoto.jpg",
    toDirectory: FilesystemDirectory.Data
});
@jcesarmobile
Copy link
Member

This should also be possible no as #250 was merged

I've added a few buttons to the sample app to verify and they seem to work fine
ionic-team/capacitor-testapp#129

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants