Skip to content

feat: Add XLSX file upload support and fix file processing logic #4833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

okurayhan
Copy link

@okurayhan okurayhan commented Jul 10, 2025

πŸ“‹ Summary

This PR adds comprehensive XLSX file upload support and fixes critical file processing bugs in Flowise.

✨ What's Changed

XLSX Support Added

  • βœ… Added XLSX to availableFileTypes in FileUpload.jsx UI component
  • βœ… Updated file extension mapping: .xlsx, .xlsm, .xlsb now map to 'csvFile'
  • βœ… Added MIME type mapping for Excel files:
    • application/vnd.ms-excel
    • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Improvements

  • πŸ“ Improved error messages in createAttachment.ts with file details

🎯 Impact

  • XLSX files now properly route to File Loader with LoadSheet functionality
  • File upload logic is more robust and handles MIME types correctly
  • Better error reporting for debugging file upload issues
  • Consistent file processing across all upload scenarios

πŸ§ͺ Testing

  • βœ… Tested XLSX file uploads through UI
  • βœ… Verified file type detection works correctly
  • βœ… Confirmed proper error handling and logging

πŸš€ Benefits

  • Users can now upload Excel files (.xlsx, .xlsm, .xlsb)
  • More reliable file processing across the system
  • Better debugging capabilities for file upload issues

Fixes potential file upload processing bugs and adds highly requested XLSX support.

- Add XLSX support to availableFileTypes in FileUpload.jsx
- Update file extension mapping: .xlsx now maps to 'file' instead of 'csvFile'
- Add MIME type mapping for Excel files (application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
- Fix critical bug in createAttachment.ts, buildChatflow.ts, upsertVector.ts: use fileInputFieldFromMimeType instead of fileInputFieldFromExt
- Improve error logging in ChatMessage.jsx for better debugging
- Enable XLSX files to be processed by File Loader with LoadSheet functionality
@okurayhan okurayhan marked this pull request as ready for review July 10, 2025 13:43
return 'csvFile'
case '.xlsm':
case '.xlsb':
return 'file'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we changing this to file ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need. I restored this lines.

@@ -371,7 +371,7 @@ export const executeFlow = async ({
if (fileInputFieldFromExt !== 'txtFile') {
fileInputField = fileInputFieldFromExt
} else if (fileInputFieldFromMimeType !== 'txtFile') {
fileInputField = fileInputFieldFromExt
fileInputField = fileInputFieldFromMimeType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why fileInputFieldFromExt to fileInputFieldFromMimeType?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need. I restored this lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants