[GH-ISSUE #1001] [FEAT]: Import unknown format as text file #615

Closed
opened 2026-02-22 18:20:28 -05:00 by yindo · 5 comments
Owner

Originally created by @nekopep on GitHub (Mar 31, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1001

What would you like to see?

Hello,
I wanted to upload a qml file (basically a javascript equivalent for QT framework).
https://doc.qt.io/qt-6/qtqml-documents-topic.html
Sadly anything-llm desktop refused it.
Perhaps it could be interesting for unsupported files, to ask the user if it ok to interpret is as js or txt or whatever is ever supported?
image

Originally created by @nekopep on GitHub (Mar 31, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1001 ### What would you like to see? Hello, I wanted to upload a qml file (basically a javascript equivalent for QT framework). https://doc.qt.io/qt-6/qtqml-documents-topic.html Sadly anything-llm desktop refused it. Perhaps it could be interesting for unsupported files, to ask the user if it ok to interpret is as js or txt or whatever is ever supported? ![image](https://github.com/Mintplex-Labs/anything-llm/assets/2825997/80b73066-7055-4a34-9e68-27ab8572a2ba)
yindo added the enhancementfeature request labels 2026-02-22 18:20:28 -05:00
yindo closed this issue 2026-02-22 18:20:28 -05:00
Author
Owner

@timothycarambat commented on GitHub (Mar 31, 2024):

Good idea! In the meantime, leaving this as a note for PR so i dont forget:
https://github.com/Mintplex-Labs/anything-llm/blob/df054eb8d7b0d0dff3751f3aaef535861000c770/collector/utils/files/mime.js#L24

Just add the relevant file extensions here and they will be passes as text/plain.

I have never heard of this file format before!

@timothycarambat commented on GitHub (Mar 31, 2024): Good idea! In the meantime, leaving this as a note for PR so i dont forget: https://github.com/Mintplex-Labs/anything-llm/blob/df054eb8d7b0d0dff3751f3aaef535861000c770/collector/utils/files/mime.js#L24 Just add the relevant file extensions here and they will be passes as text/plain. I have never heard of this file format before!
Author
Owner

@nekopep commented on GitHub (Apr 1, 2024):

Continuing my exploration, you can also add ".sh" files for bash script analysis. Can be interpreted as.txt files.

https://ryanstutorials.net/bash-scripting-tutorial/bash-script.php

@nekopep commented on GitHub (Apr 1, 2024): Continuing my exploration, you can also add ".sh" files for bash script analysis. Can be interpreted as.txt files. https://ryanstutorials.net/bash-scripting-tutorial/bash-script.php
Author
Owner

@nekopep commented on GitHub (Apr 1, 2024):

Oups, Forget this, my file did not had extension, ".sh" files are well recognised.
Is it possible to apply something like "file" on the uploaded files to find possible hidden extension or perhaps anaylsing first line shebang?

@nekopep commented on GitHub (Apr 1, 2024): Oups, Forget this, my file did not had extension, ".sh" files are well recognised. Is it possible to apply something like "file" on the uploaded files to find possible hidden extension or perhaps anaylsing first line shebang?
Author
Owner

@timothycarambat commented on GitHub (Apr 1, 2024):

We currently do this with parsing of the mime-type, which can be spoofed or broken, but its more of a convenience wrapper for forcing "unknown" files being parsed as text. SH should be handled under this as its mime should be covered? It may be text/x-shellscript

@timothycarambat commented on GitHub (Apr 1, 2024): We currently do this with parsing of the mime-type, which can be spoofed or broken, but its more of a convenience wrapper for forcing "unknown" files being parsed as text. SH should be handled under this as its mime should be covered? It may be `text/x-shellscript`
Author
Owner

@nekopep commented on GitHub (Apr 1, 2024):

Here is an example file not working, remove the extension.
(but this is less important than qml ;) )

#file ~/bashrc.d/01-alias_tools
Bourne-Again shell script, ASCII text executable

You see that the file starts with #!/bin/bash, that is bash shebang:
https://en.wikipedia.org/wiki/Shebang_(Unix)

File:
01-alias_tools.txt

@nekopep commented on GitHub (Apr 1, 2024): Here is an example file not working, remove the extension. (but this is less important than qml ;) ) #file ~/bashrc.d/01-alias_tools Bourne-Again shell script, ASCII text executable You see that the file starts with #!/bin/bash, that is bash shebang: https://en.wikipedia.org/wiki/Shebang_(Unix) File: [01-alias_tools.txt](https://github.com/Mintplex-Labs/anything-llm/files/14826941/01-alias_tools.txt)
yindo changed title from [FEAT]: Import unknown format as text file to [GH-ISSUE #1001] [FEAT]: Import unknown format as text file 2026-06-05 14:36:17 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#615