MCPcopy Index your code
hub / github.com/simstudioai/sim / uploadCsvToWorkspaceStorage

Function uploadCsvToWorkspaceStorage

apps/sim/hooks/queries/tables.ts:1452–1465  ·  view source on GitHub ↗

* Uploads a CSV/TSV straight to workspace storage (bypassing the server's request-body * cap) and returns its storage key. Shared by the async-import kickoff hooks.

(
  file: File,
  workspaceId: string,
  onProgress?: (percent: number) => void
)

Source from the content-addressed store, hash-verified

1450 * cap) and returns its storage key. Shared by the async-import kickoff hooks.
1451 */
1452async function uploadCsvToWorkspaceStorage(
1453 file: File,
1454 workspaceId: string,
1455 onProgress?: (percent: number) => void
1456): Promise<string> {
1457 const upload = await runUploadStrategy({
1458 file,
1459 workspaceId,
1460 context: 'workspace',
1461 presignedEndpoint: `/api/workspaces/${workspaceId}/files/presigned`,
1462 onProgress: onProgress ? (event) => onProgress(event.percent) : undefined,
1463 })
1464 return upload.key
1465}
1466
1467/**
1468 * Uploads a large CSV/TSV straight to storage, then kicks off a background import into a

Callers 2

useImportCsvAsyncFunction · 0.85

Calls 2

runUploadStrategyFunction · 0.90
onProgressFunction · 0.85

Tested by

no test coverage detected