diff --git a/templates/components/llamaindex/typescript/documents/upload.ts b/templates/components/llamaindex/typescript/documents/upload.ts
index 10091ce007c34eb9325facde33a9d503f04cd3d5..05070cf3dc62eb9cc417ee53f67f8034f87f9d87 100644
--- a/templates/components/llamaindex/typescript/documents/upload.ts
+++ b/templates/components/llamaindex/typescript/documents/upload.ts
@@ -49,7 +49,11 @@ export async function uploadDocument(
     }
   } else {
     // run the pipeline for other vector store indexes
-    const documents: Document[] = await parseFile(fileBuffer, name, mimeType);
+    const documents: Document[] = await parseFile(
+      fileBuffer,
+      fileMetadata.name,
+      mimeType,
+    );
     documentIds = await runPipeline(index, documents);
   }