Skip to content

Webui/file upload#18694

Merged
allozaur merged 12 commits into
ggml-org:masterfrom
ServeurpersoCom:webui/file-upload
Jan 9, 2026
Merged

Webui/file upload#18694
allozaur merged 12 commits into
ggml-org:masterfrom
ServeurpersoCom:webui/file-upload

Conversation

@ServeurpersoCom

@ServeurpersoCom ServeurpersoCom commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Make sure to read the contributing guidelines before submitting a PR

Fix restrictive file type validation in WebUI

The file upload filter was rejecting many valid text file formats (VHDL, TCL, Verilog, Makefiles without extensions, etc.) with no option to override the automatic detection

Changes:

  • Make isFileTypeSupported() inclusive by default: fallback to treating unknown files as text
  • Simplify file processing logic: remove redundant TEXT type check, let fallback handle all text files
  • Images/Audio/PDF still route to specialized handlers, everything else attempts text extraction

This resolves the issue where users had to rename files to .txt just to upload them. If a file is actually binary, the UTF-8 read will gracefully fail and the file is added without content

No more :
Remove

Tests (specific file codepath unchanged, new unknown extension supported as a text file for LLM):
VHDL
Image

Fixes #18618
Related: #17556

@ServeurpersoCom

ServeurpersoCom commented Jan 8, 2026

Copy link
Copy Markdown
Contributor Author

Potential and Optional improvement/simplification: the file picker could just offer "." by default (removes a little more existing code) since the codepath is already done in the application, and any fallback to TEXT for the LLM if unknown :

Picker

@allozaur

allozaur commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Potential and Optional improvement/simplification: the file picker could just offer "." by default (removes a little more existing code) since the codepath is already done in the application, and any fallback to TEXT for the LLM if unknown :
Picker

sure, let's improve this then :)

@ServeurpersoCom

Copy link
Copy Markdown
Contributor Author

I carefully remove a lot of code! It will be simpler, while preserving the internal modality

@pwilkin

pwilkin commented Jan 8, 2026

Copy link
Copy Markdown
Member

Yeah, I didn't want to mess too much in your mechanisms, but I feel like this is the best way to go.

@ServeurpersoCom

Copy link
Copy Markdown
Contributor Author

Yes, and it's like a cleanup PR, I like features with a negative line count! Basically, the dialog takes everything, whitelists handles the modalities redirection correctly, and anything not explicitly included inside it falls back to text. After all, LLMs love text :)

Comment thread tools/server/webui/src/lib/components/app/chat/ChatForm/ChatForm.svelte Outdated
@allozaur

allozaur commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

@ServeurpersoCom just one last thing to address is the failing checks ;) storybook tests are failing

@ServeurpersoCom

Copy link
Copy Markdown
Contributor Author

@ServeurpersoCom just one last thing to address is the failing checks ;) storybook tests are failing

I'm looking at that!

@ServeurpersoCom ServeurpersoCom force-pushed the webui/file-upload branch 2 times, most recently from 39e96d3 to 7eab604 Compare January 9, 2026 12:43
ServeurpersoCom added a commit to ServeurpersoCom/llama.cpp that referenced this pull request Jan 9, 2026
ServeurpersoCom added a commit to ServeurpersoCom/llama.cpp that referenced this pull request Jan 9, 2026
@allozaur allozaur merged commit ec8fd78 into ggml-org:master Jan 9, 2026
11 checks passed
ServeurpersoCom added a commit to ServeurpersoCom/llama.cpp that referenced this pull request Jan 12, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
ServeurpersoCom added a commit to ServeurpersoCom/llama.cpp that referenced this pull request Jan 12, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
ServeurpersoCom added a commit to ServeurpersoCom/llama.cpp that referenced this pull request Jan 12, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
ServeurpersoCom added a commit to ServeurpersoCom/llama.cpp that referenced this pull request Jan 13, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
gary149 pushed a commit to gary149/llama-agent that referenced this pull request Jan 13, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
ServeurpersoCom added a commit to ServeurpersoCom/llama.cpp that referenced this pull request Jan 13, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
dillon-blake referenced this pull request in dillon-blake/llama.cpp-BL Jan 15, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
ServeurpersoCom added a commit to ServeurpersoCom/llama.cpp that referenced this pull request Jan 17, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
phibya pushed a commit to ziee-ai/llama.cpp that referenced this pull request May 29, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
fewtarius pushed a commit to fewtarius/llama.cpp that referenced this pull request May 30, 2026
* webui: fix restrictive file type validation

* webui: simplify file processing logic

* chore: update webui build output

* webui: remove file picker extension whitelist (1/2)

* webui: remove file picker extension whitelist (2/2)

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* fix: update ChatForm storybook test after removing accept attribute

* chore: update webui build output

* refactor: more cleanup

* chore: update webui build output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it possible to override text file detection in llama-server web UI

3 participants