New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impossible to edit an empty file with certain file extensions #986
Comments
add your file extension to https://github.com/prasathmani/tinyfilemanager/blob/master/tinyfilemanager.php#L2972 |
Thanks for the response! I already did that as a temporary workaround, but personally, I would suggest to go for a more permanent solution, where the choice of files that get to be edited is less restrictive and more permissive. Known binary file MIME types (like "application/octet-stream", "video/x-matroska", ...) should be disallowed for text editing, but anything that is plain text ("text/plain" or "application/x-empty" for empty files) should be editable. The PHP |
I have tested this with the docker image tagged "master" (from Feb 26 2023), logged in as the default admin user (command used:
sudo docker run -d -v /media/jonas/renkforce/USERDATA/Minecraft/tinyfilemanager/:/var/www/html/data -p 80:80 --restart=always --name tinyfilemanager tinyfilemanager/tinyfilemanager:master
)I created a new file via the "New Item" button in the header with the name "test.mcfunction". Upon clicking on this file I noticed there is no "Edit" or "Advanced Editor" button. This button exists with other plaintext files (e.g. txt).
Attempting to edit it by using the edit URL for this file yields an empty page with no options to edit the file (
http://localhost/index.php?p=data&edit=test.mcfunction
).How can I edit this file through tinyfilemanager, without downloading and uploading it again?
I think all files that aren't definitely binary files should be editable, even if their file extension is unknown.
The text was updated successfully, but these errors were encountered: