fix: add "video" into supported MIME types when uploading files
This commit is contained in:
parent
9fe03f3425
commit
dbe25cec8e
@ -681,7 +681,7 @@ def upload():
|
|||||||
log.info('web: - targetdir: ' + targetdir)
|
log.info('web: - targetdir: ' + targetdir)
|
||||||
log.info('web: - mimetype: ' + file.mimetype)
|
log.info('web: - mimetype: ' + file.mimetype)
|
||||||
|
|
||||||
if "audio" in file.mimetype:
|
if "audio" in file.mimetype or "video" in file.mimetype:
|
||||||
storagepath = os.path.abspath(os.path.join(var.music_folder, targetdir))
|
storagepath = os.path.abspath(os.path.join(var.music_folder, targetdir))
|
||||||
if not storagepath.startswith(os.path.abspath(var.music_folder)):
|
if not storagepath.startswith(os.path.abspath(var.music_folder)):
|
||||||
abort(403)
|
abort(403)
|
||||||
|
@ -919,7 +919,7 @@ function uploadStart() {
|
|||||||
if (file.size > maxFileSize) {
|
if (file.size > maxFileSize) {
|
||||||
setUploadError(file.name, 'File too large!');
|
setUploadError(file.name, 'File too large!');
|
||||||
continue;
|
continue;
|
||||||
} else if (!file.type.includes('audio')) {
|
} else if (!(file.type.includes('audio') || file.type.includes('video'))) {
|
||||||
setUploadError(file.name, 'Unsupported media format!');
|
setUploadError(file.name, 'Unsupported media format!');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user