drupflare/worker - v1.0.0
    Preparing search index...

    Function putFile

    • Stores a file, replacing any previous copy.

      The old chunks are deleted FIRST and unconditionally. Overwriting a 3-chunk file with a 1-chunk one by INSERT OR REPLACE alone would leave chunks 1 and 2 behind, and the next read -- which trusts chunks from the metadata row -- would return the new first chunk followed by nothing, silently truncating. Worse, a later overwrite back up to 3 chunks would splice the new chunk 0 onto the ORIGINAL chunks 1 and 2 and produce a file that never existed.

      Parameters

      • sql: FileSql
      • uri: string
      • bytes: Uint8Array
      • opts: { chunkSize?: number; mime?: string | null; nowMs: number } = ...

      Returns PutResult