Hello everyone,
I’m still learning how to use JavaScript effectively with WEBCON BPS.
Currently, I’m working on a project that involves an HTML button/JavaScript triggering a file download at the end:
JAVASCRIPT:
// Save the PDF and offer it for download
const pollerPdfBytes = await pollerPdf.save();
const blob = new Blob([pollerPdfBytes], { type: 'application/pdf' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = 'poller.pdf';
link.click();
URL.revokeObjectURL(url);
});
</script>
This works perfectly.
However, instead of downloading the file, I would prefer to attach the file (poller.pdf) directly to the current instance as an attachment.
Is this even possible with JavaScript?
If not, what other options could I use?
I’d be grateful for any tips that could help me move forward.
Best regards,
Bjoern