{"record":{"id":"5778711cffac695b","repo":"paperclipai/paperclip","slug":"select-a-zip-company-package","errorCode":null,"errorMessage":"Select a .zip company package.","messagePattern":"Select a \\.zip company package\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ui/src/pages/CompanyImport.tsx","lineNumber":700,"sourceCode":"}\n\n// ── Helpers ───────────────────────────────────────────────────────────\n\nasync function readLocalPackageZip(file: File): Promise<{\n  name: string;\n  /**\n   * The raw .zip File itself. Local imports upload this compressed file as\n   * multipart instead of inflating it into one large inline JSON body (which\n   * truncated in transit on big companies); the parsed `files` map below is\n   * kept only for the client-side preflight display and preview affordances.\n   */\n  file: File;\n  compressedBytes: number;\n  rootPath: string | null;\n  files: Record<string, CompanyPortabilityFileEntry>;\n}> {\n  if (!/\\.zip$/i.test(file.name)) {\n    throw new Error(\"Select a .zip company package.\");\n  }\n  const archive = await readZipArchive(await file.arrayBuffer());\n  if (Object.keys(archive.files).length === 0) {\n    throw new Error(\"No package files were found in the selected zip archive.\");\n  }\n  return {\n    name: file.name,\n    file,\n    compressedBytes: file.size,\n    rootPath: archive.rootPath,\n    files: archive.files,\n  };\n}\n\n// ── Chunked transfer flow for large local zips ───────────────────────\n//\n// A local .zip over the threshold is not uploaded in one request: one dropped\n// connection would restart the whole multi-minute upload. Instead the file is","sourceCodeStart":682,"sourceCodeEnd":718,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/ui/src/pages/CompanyImport.tsx#L682-L718","documentation":"Input-format guard in readLocalPackageZip: the chosen File's name fails the .zip extension test, so the local company-package import refuses the file before attempting to open it as an archive. The faulting input is the browser File object passed by the package picker.","triggerScenarios":"Thrown at ui/src/pages/CompanyImport.tsx:700 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a .zip company package file to import."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}