{"record":{"id":"b39b818795cd61f9","repo":"toeverything/AFFiNE","slug":"this-import-has-too-many-files-for-the-web-app-pl","errorCode":null,"errorMessage":"This import has too many files for the web app. Please import it in the desktop client.","messagePattern":"This import has too many files for the web app\\. Please import it in the desktop client\\.","errorType":"exception","errorClass":"WebImportLimitError","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/desktop/dialogs/import/web-limits.ts","lineNumber":36,"sourceCode":"  constructor(message: string) {\n    super(message);\n    this.name = 'WebImportLimitError';\n  }\n}\n\nexport async function preflightWebZipImport(\n  file: File,\n  limits = webImportLimits\n) {\n  if (file.size > limits.maxTotalBytes) {\n    throw new WebImportLimitError(\n      'This import is too large for the web app. Please import it in the desktop client.'\n    );\n  }\n\n  const entries = readZipDirectory(new Uint8Array(await file.arrayBuffer()));\n  if (entries.length > limits.maxEntryCount) {\n    throw new WebImportLimitError(\n      'This import has too many files for the web app. Please import it in the desktop client.'\n    );\n  }\n\n  const documentCount = entries.filter(entry =>\n    isWebImportDocument(entry.name)\n  ).length;\n  if (documentCount > limits.maxDocumentCount) {\n    throw new WebImportLimitError(\n      'This import has too many documents for the web app. Please import it in the desktop client.'\n    );\n  }\n\n  for (const entry of entries) {\n    if (entry.uncompressedSize > limits.maxEntryBytes) {\n      throw new WebImportLimitError(\n        'This import contains a file that is too large for the web app. Please import it in the desktop client.'\n      );","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/desktop/dialogs/import/web-limits.ts#L18-L54","documentation":"preflightWebZipImport enforces web-only import limits; when the zip's entry count exceeds limits.maxEntryCount it throws WebImportLimitError advising the desktop client. (Larger total size triggers a sibling message from the same function.)","triggerScenarios":"Thrown by preflightWebZipImport or preflightWebFilesImport when the entry/file count exceeds webImportLimits.maxEntryCount (1000).","commonSituations":"Occurs with archives or folders containing more than 1000 files. Reduce the file count or import via the desktop client.","solutions":["Import using the desktop client which has no file-count limit.","Reduce the number of files in the archive."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}