paperclipai/paperclip · error

Unsupported file type: ${contentType || "unknown"}

Error message

Unsupported file type: ${contentType || "unknown"}

What it means

Error "Unsupported file type: ${contentType || "unknown"}" thrown in paperclipai/paperclip.

Source

Thrown at server/src/routes/assets.ts:144

          });
          return;
        }
        res.status(400).json({ error: err.message });
        return;
      }
      throw err;
    }

    const file = (req as Request & { file?: { mimetype: string; buffer: Buffer; originalname: string } }).file;
    if (!file) {
      res.status(400).json({ error: "Missing file field 'file'" });
      return;
    }

    const parsedMeta = createAssetImageMetadataSchema.safeParse(req.body ?? {});
    if (!parsedMeta.success) {
      res.status(400).json({
        error: `Invalid image metadata: ${ASSET_NAMESPACE_RULE}`,
        details: parsedMeta.error.issues,
      });
      return;
    }

    const namespaceSuffix = parsedMeta.data.namespace ?? "general";
    const contentType = (file.mimetype || "").toLowerCase();
    if (contentType !== SVG_CONTENT_TYPE && !isAllowedContentType(contentType)) {
      res.status(422).json({ error: `Unsupported file type: ${contentType || "unknown"}` });
      return;
    }
    let fileBody = file.buffer;
    if (contentType === SVG_CONTENT_TYPE) {
      const sanitized = sanitizeSvgBuffer(file.buffer);
      if (!sanitized || sanitized.length <= 0) {
        res.status(422).json({ error: "SVG could not be sanitized" });
        return;
      }

View on GitHub (pinned to 01ad858492)

Solutions

  1. Upload a file with a supported content type.

When it happens

Trigger: Thrown at server/src/routes/assets.ts:143 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18). Data as JSON: /api/errors/153256b452b622d3. Report an issue: GitHub.