Bugfix/Address file name with special chars (#3496)

address file name with special chars
This commit is contained in:
Henry Heng
2024-11-09 15:21:09 +00:00
committed by GitHub
parent 0153735704
commit 1e2dc03527
6 changed files with 14 additions and 3 deletions
@@ -702,7 +702,6 @@ export const ChatMessage = ({ open, chatflowid, isAgentCanvas, isDialog, preview
if (fullFileUpload) {
const filesWithFullUploadType = uploadedFiles.filter((file) => file.type === 'file:full')
if (filesWithFullUploadType.length > 0) {
const formData = new FormData()
for (const file of filesWithFullUploadType) {
@@ -712,12 +711,14 @@ export const ChatMessage = ({ open, chatflowid, isAgentCanvas, isDialog, preview
const response = await attachmentsApi.createAttachment(chatflowid, chatId, formData)
const data = response.data
for (const extractedFileData of data) {
const content = extractedFileData.content
const fileName = extractedFileData.name
// find matching name in previews and replace data with content
const uploadIndex = uploads.findIndex((upload) => upload.name === fileName)
if (uploadIndex !== -1) {
uploads[uploadIndex] = {
...uploads[uploadIndex],