Display document from My Files in Chat #8904
-
|
I have identified that location of my file is found in path : Is there a way that I could show this document as a link in chat? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
You can display your PDF as a clickable link in chat if you generate a download URL using Langflow's file API. The backend exposes an endpoint for downloading files, so you can construct a link like: The chat interface uses a Markdown renderer that supports links, so pasting a markdown-formatted link like the above should render it as clickable in chat, as long as the message renderer is enabled for markdown in your context. The file will be served securely as an attachment via the API when the link is clicked (source, renderer). If you want a more integrated experience (like a download button or file preview), the chat UI uses a custom FileCard component for uploaded files, but direct markdown links are the simplest way to show a link in chat. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
@disu what´s that [Download PDF] you refer to ? can you give example |
Beta Was this translation helpful? Give feedback.
Right now, the file download endpoint in Langflow always sets the Content-Disposition header to "attachment", which forces browsers to download the PDF instead of displaying it inline—even if you open the link in a new tab. To display the PDF directly in the browser, the backend would need to set Content-Disposition to "inline" for PDF files, but this isn't supported by the current API or any configuration options (source).
If you want inline display, the backend code would need to be changed to either add a new endpoint or a parameter that sets Content-Disposition to "inline" for PDFs. As it stands, there’s no built-in way to do this just by changing the URL or using markdown in chat.
T…