You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
feat: add upload file list with progress (#1825)
This commit is contained in:
@@ -99,6 +99,15 @@ export function scanFiles(dt) {
|
||||
});
|
||||
}
|
||||
|
||||
function detectType(mimetype) {
|
||||
if (mimetype.startsWith("video")) return "video";
|
||||
if (mimetype.startsWith("audio")) return "audio";
|
||||
if (mimetype.startsWith("image")) return "image";
|
||||
if (mimetype.startsWith("pdf")) return "pdf";
|
||||
if (mimetype.startsWith("text")) return "text";
|
||||
return "blob";
|
||||
}
|
||||
|
||||
export function handleFiles(files, base, overwrite = false) {
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
let id = store.state.upload.id;
|
||||
@@ -120,6 +129,7 @@ export function handleFiles(files, base, overwrite = false) {
|
||||
path,
|
||||
file,
|
||||
overwrite,
|
||||
type: detectType(file.type),
|
||||
};
|
||||
|
||||
store.dispatch("upload/upload", item);
|
||||
|
||||
Reference in New Issue
Block a user