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

Skip type lookup if file has no ext

parent 30387bf1
No related branches found
No related tags found
No related merge requests found
......@@ -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