Skip to content
Snippets Groups Projects
Commit 02d09d9d authored by echicken's avatar echicken :chicken:
Browse files

Skip type lookup if file has no ext

parent 1e28b7ce
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -38,11 +38,13 @@ function listFiles(dir) {
// Where file is a FileBase file record
function getMimeType(file) {
const f = new File(system.ctrl_dir + 'mime_types.ini');
if (f.open('r')) {
const mimes = f.iniGetObject();
f.close();
if (mimes[file.ext] !== undefined) return mimes[file.ext];
if (file.ext) {
const f = new File(system.ctrl_dir + 'mime_types.ini');
if (f.open('r')) {
const mimes = f.iniGetObject();
f.close();
if (mimes[file.ext] !== undefined) return mimes[file.ext];
}
}
return 'application/octet-stream';
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment