Skip to content

Comments

fix(web): Check the existence of the folder before mkdir.#33

Merged
OS-pedrogustavobilro merged 1 commit intoionic-team:mainfrom
bear-shen:main
Jan 26, 2026
Merged

fix(web): Check the existence of the folder before mkdir.#33
OS-pedrogustavobilro merged 1 commit intoionic-team:mainfrom
bear-shen:main

Conversation

@bear-shen
Copy link
Contributor

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

@OS-pedrogustavobilro OS-pedrogustavobilro self-assigned this Jan 26, 2026
@OS-pedrogustavobilro
Copy link
Contributor

Thanks for the contribution!

@OS-pedrogustavobilro OS-pedrogustavobilro merged commit 0f0658f into ionic-team:main Jan 26, 2026
capacitor-bot pushed a commit that referenced this pull request Feb 10, 2026
## [2.0.4](v2.0.3...v2.0.4) (2026-02-10)

### Bug Fixes

* Align HTTP error message ([#55](#55)) ([a1702d0](a1702d0))
* **android:** AGP 9.0 no longer supporting `proguard-android.txt` ([#57](#57)) ([2eea2f7](2eea2f7))
* **ios:** http body in error and send progress only when success ([#59](#59)) ([da7a5fd](da7a5fd))
* **web:** Check the existence of the folder before mkdir. ([#33](#33)) ([0f0658f](0f0658f))
capacitor-bot pushed a commit that referenced this pull request Feb 11, 2026
## [1.0.10](v1.0.9...v1.0.10) (2026-02-11)

### Bug Fixes

* Align HTTP error message ([#55](#55)) ([d50c7d6](d50c7d6))
* **android:** Correctly returning headers for upload ([#46](#46)) ([93eab42](93eab42))
* **ios:** http body in error and send progress only when success ([#59](#59)) ([d0e43cc](d0e43cc))
* **ios:** Send upload response code as string instead of number ([#49](#49)) ([ba0c1d2](ba0c1d2))
* **web:** Check the existence of the folder before mkdir. ([#33](#33)) ([58ea4b6](58ea4b6))
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.

2 participants