|
|
@@ -144,7 +144,7 @@ const genUploadedLabel = (responseText: string, vditor: IVditor) => {
|
|
|
|
|
|
const uploadFiles = (vditor: IVditor, files: FileList | DataTransferItemList | File[], element?: HTMLInputElement) => {
|
|
|
// FileList | DataTransferItemList | File[] => File[]
|
|
|
- const fileList = [];
|
|
|
+ let fileList = [];
|
|
|
for (let iMax = files.length, i = 0; i < iMax; i++) {
|
|
|
let fileItem = files[i];
|
|
|
if (fileItem instanceof DataTransferItem) {
|
|
|
@@ -170,6 +170,10 @@ const uploadFiles = (vditor: IVditor, files: FileList | DataTransferItemList | F
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if (vditor.options.upload.file) {
|
|
|
+ fileList = vditor.options.upload.file(fileList);
|
|
|
+ }
|
|
|
+
|
|
|
if (vditor.options.upload.validate) {
|
|
|
const isValidate = vditor.options.upload.validate(fileList);
|
|
|
if (typeof isValidate === "string") {
|