ruvnet/ruflo · error · Error

File type not allowed.

Error message

File type not allowed.

What it means

After fetching through the proxy, the x-forwarded-content-type header (or blob MIME) did not match any of the accepted acceptMimeTypes configured for this attachment flow. The remote file's type is disallowed, so no File object is created and the modal shows the error.

Source

Thrown at ruflo/src/ruvocal/src/lib/components/chat/UrlFetchModal.svelte:90

			return;
		}
		loading = true;
		try {
			// Use server proxy directly for one URL to validate size/types before creating File
			const params = new URLSearchParams({ url: trimmed });
			if (acceptMimeTypes.length > 0) params.set("accept", acceptMimeTypes.join(","));
			const proxyUrl = `${base}/api/fetch-url?${params}`;
			const res = await fetch(proxyUrl);
			if (!res.ok) {
				const txt = await res.text();
				throw new Error(txt || `Failed to fetch (${res.status})`);
			}
			const forwardedType = res.headers.get("x-forwarded-content-type");
			const blob = await res.blob();
			const mimeType = pickSafeMime(forwardedType, blob.type, trimmed);
			// Optional client-side mime filter (same wildcard semantics as dropzone)
			if (acceptMimeTypes.length > 0 && mimeType && !matchesAllowed(mimeType, acceptMimeTypes)) {
				throw new Error("File type not allowed.");
			}
			const disp = res.headers.get("content-disposition");
			const filename = (() => {
				const filenameStar = disp?.match(/filename\*=UTF-8''([^;]+)/i)?.[1];
				if (filenameStar) {
					const cleaned = filenameStar.trim().replace(/['"]/g, "");
					try {
						return decodeURIComponent(cleaned);
					} catch {
						return cleaned;
					}
				}
				const filenameMatch = disp?.match(/filename="?([^";]+)"?/i)?.[1];
				if (filenameMatch) return filenameMatch.trim();
				try {
					const u = new URL(trimmed);
					const last = u.pathname.split("/").pop() || "attachment";
					return decodeURIComponent(last);

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Upload a file whose extension/MIME type is in the allowed list.
  2. Add the file type to the allowlist only after confirming it can be processed safely.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at ruflo/src/ruvocal/src/lib/components/chat/UrlFetchModal.svelte:90 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/14d39516a4e8f593. Report an issue: GitHub.