storage.createUploadSession()
Opens an upload session for a file in the default explorer namespace.
Notes:
- For caller Private:
storage.createUploadSession('private', input). Keep rows in execution; use completegetFileDataheaders. Return only finalized entry and readback verification. - Unavailable with
readOnly: true(throws an error). - A durable session reserves name/destination and records upload policy,
ACL, retention, schema, and progress. Its readable Storage entry exists
only at
FINALIZED. uploadModecontrols how bytes arrive.directreturns a temporary upload target for the complete file.chunkedaccepts caller-numbered parts.incrementalassigns part numbers by default and also accepts an explicit number for repair.writeModeis independent: it controls only CSV/XLSX row materialization (stagedor declared-schemadirect).- Use incremental sessions for append-style writes. Managed direct uploads are
finalized automatically after Storage confirms the transfer; observe the
session until
FINALIZEDand do not callfinalizeUploadSessionfor that path. Explicitly finalize chunked and incremental sessions. - Structured CSV/TSV and XLSX sessions default to
computeStats: 'sync'so byte maps, row indexes, and file stats are ready after finalize. Texttext/*upload sessions also default tosync; other binary sessions default tonone. An explicit compute mode always overrides the default. ThestagedXLSX path may still persist its reusable index whennoneis explicit; structureddirectwithnoneskips it. Both default towriteMode: 'staged'. - XLSX, CSV, and TSV share
schemaPolicy: { profile?, additionalProperties? }plussheets[].table.columns[]. CSV/TSV has one logical sheet. Column types are string, number, boolean, date, and object; object parses only a JSON object or array. The default fallback policy leaves an incompatible whole column as strings and records diagnostics without replacing cells with null.profile: 'strict'fails indexing on missing columns, invalid values, or sheet mismatches.additionalPropertiesindependently controls extra source columns:allowretains,stripomits from structured rows, andrejectfails indexing. The default is fallback + allow; strict defaults to reject. Use strict + strip when extra columns may appear but the declared layout and value types must match. The raw file remains available. - Set
restricted: truewith explicitusersand/orgroupsto define the finalized entry ACL. These relations may be changed later withstorage.updateEntry(...);restricted: falseclears them. UsewriteMode: 'direct'for configured CSV/XLSX row exports with a declared schema. For XLSX, declare every worksheet with a non-emptytable.columnsbefore appending; direct XLSX parts are row-only and cannot containcells. Use the defaultstagedmode when append requests can be retried, replaced, reordered, or need inferred columns, sparse cells, formulas, or dynamic worksheets. A singlesheetspart can append rows to multiple declared worksheets. Staged mode is the durable default for independent requests that may be retried, replaced, reordered, or use inferred columns, sparse cells, formulas, or dynamic worksheets.

