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

getMimeType

parent 76ec240a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -35,3 +35,14 @@ function listFiles(dir) {
return df;
});
}
// 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];
}
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