Skip to content
Snippets Groups Projects
Commit b59a19c1 authored by syuilo's avatar syuilo
Browse files

Fix #7576

parent 558d288e
No related branches found
No related tags found
No related merge requests found
import * as os from '@client/os';
import { i18n } from '@client/i18n';
import { defaultStore } from '@client/store';
export function selectFile(src: any, label: string | null, multiple = false) {
return new Promise((res, rej) => {
......@@ -8,7 +9,7 @@ export function selectFile(src: any, label: string | null, multiple = false) {
input.type = 'file';
input.multiple = multiple;
input.onchange = () => {
const promises = Array.from(input.files).map(file => os.upload(file));
const promises = Array.from(input.files).map(file => os.upload(file, defaultStore.state.uploadFolder));
Promise.all(promises).then(driveFiles => {
res(multiple ? driveFiles : driveFiles[0]);
......@@ -57,6 +58,7 @@ export function selectFile(src: any, label: string | null, multiple = false) {
os.api('drive/files/upload-from-url', {
url: url,
folderId: defaultStore.state.uploadFolder,
marker
});
......
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