From 39c3d0e852014afa73b9e5efcd306cc8afc0ecfa Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle <patrizio@bekerle.com> Date: Wed, 13 May 2020 14:16:58 +0200 Subject: [PATCH] Add upload parameter support (VPU/Apps/Signature#5) --- packages/file-handling/src/fileupload.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/file-handling/src/fileupload.js b/packages/file-handling/src/fileupload.js index 3e538743..6be78df5 100644 --- a/packages/file-handling/src/fileupload.js +++ b/packages/file-handling/src/fileupload.js @@ -225,14 +225,15 @@ export class FileUpload extends ScopedElementsMixin(VPULitElement) { /** * @param file + * @param params * @returns {Promise<void>} */ - async uploadFile(file) { + async uploadFile(file, params = {}) { this.uploadInProgress = true; this.sendStartEvent(file); - let url = this.url; + let url = new URL(this.url) + url.search = new URLSearchParams(params).toString(); let formData = new FormData(); - formData.append('file', file); // I got a 60s timeout in Google Chrome and found no way to increase that -- GitLab