Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: decode uri component in mes file preview

Brad Barbind42f253eff5f
diff --git a/apps/mes/app/routes/file+/preview+/$bucket.$.tsx b/apps/mes/app/routes/file+/preview+/$bucket.$.tsx
index 7da54efd14..97b5e2661d 100644
--- a/apps/mes/app/routes/file+/preview+/$bucket.$.tsx
+++ b/apps/mes/app/routes/file+/preview+/$bucket.$.tsx
@@ -35,11 +35,13 @@ const supportedFileTypes: Record<string, string> = {
export let loader = async ({ request, params }: LoaderFunctionArgs) => {
const { companyId } = await requirePermissions(request, {});
const { bucket } = params;
- const path = params["*"];
+ let path = params["*"];
if (!bucket) throw new Error("Bucket not found");
if (!path) throw new Error("Path not found");
+ path = decodeURIComponent(path);
+
const fileType = path.split(".").pop()?.toLowerCase();
if (!fileType) {