Skip to content

Conversation

@bear-shen
Copy link

capacitor-filesystem throws error on mkdir when directory already exists
so we need a check before mkdir

otherwise, like this demo

const src = 'http://127.0.0.1:8080/a.mp4';
const tgt = 'video/sample.mp4';

  const fileInfo = await Filesystem.getUri({
    directory: Directory.Documents,
    path: tgt,
  });

  await FileTransfer.downloadFile({
    url: src,
    path: fileInfo.uri,
    progress: true
  });

first time boot, ok
second time, will throw error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant