Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Fix file upload filename issues (#1694)
Musthaq Ahamad committed
Jun 25, 2025 at 12:17 UTC
7792dd4e13dba3e851ec02a9681b65eb955f00bf
1 file changed
+2
-2
ts/packages/core/src/utils/fileUtils.ts
+2
-2
@@ -11,7 +11,7 @@ const readFileContent = async (
11
try {
12
const content = require('fs').readFileSync(path);
13
return {
14
- fileName: path,
14
+ fileName: pathModule.basename(path) || `file_${Date.now()}.${path.split('.').pop()}`,
15
content: content.toString('base64'),
16
mimeType: 'application/octet-stream',
17
};
@@ -33,7 +33,7 @@ const readFileContentFromURL = async (
33
return {
34
content: content.toString('base64'),
35
mimeType,
36
- fileName: path,
36
+ fileName: pathModule.basename(path) || `file_${Date.now()}.${path.split('.').pop()}`,
37
};
38
};
39