Add ability to upload/attach .cshtml files into the chat #6918
tazbytes2019
started this conversation in
Feature Requests & Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
I'm running into an issue trying to upload .cshtml files using the chat attachment paperclip icon and could use some guidance. My goal is to upload these for code refactoring.
When I click the paperclip and select a .cshtml file, I immediately get the error "Unable to determine file type" in the UI.
My Setup:
LibreChat via Docker (using docker-compose) on Windows 10.
Image: ghcr.io/danny-avila/librechat-dev:latest (Logs show backend v0.7.7).
Endpoints: OpenAI, Google, Anthropic.
Using docker-compose.override.yml to mount a custom librechat.yaml.
Server-Side Config: Initially focused on librechat.yaml. Added various MIME types (text/html, text/plain, application/octet-stream, even /) to supportedMimeTypes under default. (confirmed loaded via logs):
Test: Renaming MyPage.cshtml to MyPage.txt allows the file to upload successfully.
Sample librechat.yaml
fileConfig:
endpoints:
default:
supportedMimeTypes:
- "text/html" # HTML files
- "text/plain" # Plain text files
- "text/css" # CSS files
- "application/octet-stream" # Generic fallback type
- "text/cshtml"
Possibly client-side; JavaScript running in the browser is blocking the upload before it even attempts to send the file to the server. Tried multiple browsers.
The server-side fileConfig is correctly mounted and loaded but is never reached by the .cshtml file.
Investigating the frontend code (client/src/components/), it seems the standard attachment button (attachFile.tsx) uses an imported component. I suspect this might be reusing a component (like the FileUpload.tsx I found that has accept=".json" hardcoded) or contains other client-side validation logic that incorrectly blocks .cshtml files, even though renaming to .txt works.
Has anyone encountered this specific client-side block for non-standard file extensions like .cshtml in v0.7.7 or recent dev builds?
Version Information
PS C:\librechat> docker images | Select-String "librechat"
ghcr.io/danny-avila/librechat-dev latest a1bdbef66995 7 days ago 919MB
ghcr.io/danny-avila/librechat-rag-api-dev-lite latest 817faebddae9 7 days ago 1.31GB
ghcr.io/danny-avila/librechat-dev ae4cbaa8e590 2 weeks ago 920MB
ghcr.io/danny-avila/librechat-rag-api-dev-lite dd05389daecc 2 weeks ago 1.31GB
Steps to Reproduce
Open a new chat in the browser UI, using an API model from Anthropic, OpenAI and google. Tried GPT4o and Gemini 2.5 and Claude 3.5 and 3.7. All same results
Tried Edge, Chrome, Firefox
Either drag and drop a .cshtml file or upload .cshtml files using the chat attachment paperclip icon.
immediately get the error "Unable to determine file type" in the UI.
Renaming MyPage.cshtml to MyPage.txt allows the file to upload successfully
What browsers are you seeing the problem on?
Microsoft Edge
Relevant log output
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions