Skip to content

showSaveFilePicker: writable.write with position would resulting wierd file #72

Open
@DeltaLaboratory

Description

@DeltaLaboratory
import {
  showSaveFilePicker
} from 'native-file-system-adapter';

let file = await showSaveFilePicker({
  suggestedName: fileMeta.name
});
const writable = await file.createWritable();
let promises = [];
for (let i = 0; i < 10; i++) {
  // recieve some file at buffer 
  promises.push(new Promise(async (r) => {
      await writable.write({
        type: 'write',
        data: buffer,
        position: i * 1024 * 1024 * 100
      });
      r();
    })
  })
}

await Promise.all(promises)
await writable.close();

Browser: Firefox 123.01, Chrome mobile etc -> browsers not supporting showSaveFilePicker natively

will resulting partially written file. it may be impossible to implement this in current fallback but i didnt really read library code so just create issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions