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 deleteFile method: only require path parameter #136

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

feat: Filesystem deleteFile method: only require path parameter #136

dotNetkow opened this issue Dec 12, 2020 · 4 comments

Comments

@dotNetkow
Copy link

Feature Request

Description

The ReadFile method requires only the path parameter:

const file = await Filesystem.readFile({
  path: cameraPhoto.path
});

but deleteFile asks for the directory too. As a result, I have to extract just the filename out of the complete path as an extra step. Could Capacitor parse that for us?

const filename = photo.filepath.substr(photo.filepath.lastIndexOf('/') + 1);
await Filesystem.deleteFile({
  path: filename,  // 123.jpg
  directory: FilesystemDirectory.Data
});

Could just be:

await Filesystem.deleteFile({
  path: "file:///data/user/0/io.ionic.pg.ng.cap/cache/123.jpg"
});
@imhoffd imhoffd transferred this issue from ionic-team/capacitor Dec 13, 2020
@jcesarmobile
Copy link
Member

should be possible now
#250

@dotNetkow
Copy link
Author

yesssss sweet, i'll try it

@jcesarmobile
Copy link
Member

it's not released yet, so don't report an issue if it doesn't work 😛

@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

4 participants