MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / downloadFile

Function downloadFile

packages/ui/src/views/chatmessage/ChatMessage.jsx:1282–1300  ·  view source on GitHub ↗
(fileAnnotation)

Source from the content-addressed store, hash-verified

1280 }
1281
1282 const downloadFile = async (fileAnnotation) => {
1283 try {
1284 const response = await axios.post(
1285 `${baseURL}/api/v1/openai-assistants-file/download`,
1286 { fileName: fileAnnotation.fileName, chatflowId: chatflowid, chatId: chatId },
1287 { responseType: 'blob' }
1288 )
1289 const blob = new Blob([response.data], { type: response.headers['content-type'] })
1290 const downloadUrl = window.URL.createObjectURL(blob)
1291 const link = document.createElement('a')
1292 link.href = downloadUrl
1293 link.download = fileAnnotation.fileName
1294 document.body.appendChild(link)
1295 link.click()
1296 link.remove()
1297 } catch (error) {
1298 console.error('Download failed:', error)
1299 }
1300 }
1301
1302 const getAgentIcon = (nodeName, instructions) => {
1303 if (nodeName) {

Callers 1

ChatMessageFunction · 0.70

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected