{"record":{"id":"2c92e9ea48bfc587","repo":"Budibase/budibase","slug":"no-file-provided","errorCode":null,"errorMessage":"No file provided","messagePattern":"No file provided","errorType":"http","errorClass":"BadRequestError","httpStatus":400,"severity":"error","filePath":"packages/server/src/api/controllers/static/index.ts","lineNumber":253,"sourceCode":"  return upload.filepath\n}\n\nconst getUploadMimeType = (file: unknown) => {\n  if (!file || typeof file !== \"object\") {\n    return undefined\n  }\n  const upload = file as {\n    mimetype?: string | null\n  }\n  return upload.mimetype || undefined\n}\n\nexport const uploadFile = async function (\n  ctx: Ctx<void, ProcessAttachmentResponse>\n) {\n  const file = ctx.request?.files?.file\n  if (!file) {\n    throw new BadRequestError(\"No file provided\")\n  }\n\n  let files = file && Array.isArray(file) ? Array.from(file) : [file]\n\n  ctx.body = await Promise.all(\n    files.map(async file => {\n      const fileName = getUploadFilename(file)\n      const filePath = getUploadPath(file)\n      const rawMimeType = getUploadMimeType(file)\n      if (!fileName) {\n        throw new BadRequestError(\n          \"Attempted to upload a file without a filename\"\n        )\n      }\n      if (!filePath) {\n        throw new BadRequestError(\"Attempted to upload a file without a path\")\n      }\n","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/api/controllers/static/index.ts#L235-L271","documentation":"Thrown by uploadFile when ctx.request.files.file is missing from a multipart upload request. The endpoint expects a multipart/form-data body with a file field; without it there is nothing to process.","triggerScenarios":"POSTing to the file upload endpoint without a 'file' part, sending JSON instead of multipart/form-data, or using a different field name (e.g. 'attachment').","commonSituations":"Client forgetting to set enctype='multipart/form-data', SDK clients sending the file under the wrong form key, or proxies stripping the body.","solutions":["Send multipart/form-data with the file under the field name 'file'","Check the HTTP client attaches the file part correctly (e.g. FormData.append('file', blob))","Verify no proxy/middleware is dropping the request body"],"exampleFix":"// before\nconst fd = new FormData(); fd.append('attachment', file)\n// after\nconst fd = new FormData(); fd.append('file', file)","handlingStrategy":"validation","validationCode":"function hasFilePart(form: FormData) {\n  const f = form.get('file')\n  return f instanceof File || f instanceof Blob\n}","typeGuard":"const isUploadedFile = (f: unknown): f is { filename?: string; path?: string; size: number } =>\n  typeof f === 'object' && f !== null && 'size' in f","tryCatchPattern":"try {\n  await api.uploadFile(formData)\n} catch (err) {\n  if (err instanceof BadRequestError && err.message === 'No file provided') {\n    // fix the form field name to 'file' and resend\n  } else throw err\n}","preventionTips":["Always send multipart/form-data with the part named exactly 'file'","Verify with devtools that the request contains a file part","Ensure the form enctype is multipart/form-data"],"tags":["upload","multipart","validation"],"backgroundTag":"missing-upload-file","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}