diff --git a/src/components/renderer/file-download.vue b/src/components/renderer/file-download.vue index 395a7d9f..8737a916 100644 --- a/src/components/renderer/file-download.vue +++ b/src/components/renderer/file-download.vue @@ -121,6 +121,9 @@ export default { this.setFilesInfo(); }, methods: { + isWebEntryTemporaryFileId(fileId) { + return typeof fileId === "string" && fileId.startsWith("webentry_"); + }, downloadFile(file) { if (this.collection) { this.downloadCollectionFile(file); @@ -209,6 +212,12 @@ export default { const fileId = this.value ? this.value : _.get(this.requestData, this.fileDataName, null); + + if (this.isWebEntryTemporaryFileId(fileId)) { + this.filesInfo = []; + return; + } + let { endpoint } = this; if (this.requestFiles) { diff --git a/tests/unit/FileDownloadUtils.spec.js b/tests/unit/FileDownloadUtils.spec.js new file mode 100644 index 00000000..2acf8a66 --- /dev/null +++ b/tests/unit/FileDownloadUtils.spec.js @@ -0,0 +1,49 @@ +const fs = require("fs"); +const path = require("path"); +const vm = require("vm"); + +const componentPath = path.join( + process.cwd(), + "src/components/renderer/file-download.vue" +); + +const source = fs.readFileSync(componentPath, "utf8"); + +function getComponentOptions() { + const scriptMatch = source.match(/