Use File/Blob Javascript API in 8.1
-
Dominik Lipp11 months ago #42411
Hello,
I was experimenting with ECMAScript Support in serverside BOs and stumbled upon a JS feature which resulted in an error.
I tried to create a Blob / File with the following example code:
let blob = new Blob([‘hello’, ‘ ‘, ‘world’], {type: ‘text/plain’});
Error:
Unexpected Runtime exception: ReferenceError: Blob is not defined
For compatibility informations, see the mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Blob
As far as I read, it should be supported, because it is standard JS API and is also supported in server implementations like NodeJS.
Do I have a misunderstanding of the JS support in GraalVM?
Benjamin WieseHas successfully completed the online course IntroductionHas successfully completed the online course Basics (100)Dominik Lipp11 months ago #42464::In our use case, we would want to create files or blobs based on some data in the backend and send the file/blob to the user via the bo. We explicitely do not want to send B64 Strings.
We do not need access to files on the filesystem and do not want to write files permanently to the filesystem.
Benjamin WieseHas successfully completed the online course IntroductionHas successfully completed the online course Basics (100)11 months ago #42526::Since the File / Blob API is not part of ECMAScript, it is currently not supported by Simplifier. This means unfortunately that B64 is the only way at this point. You can however create a Feature Request in our Portal for adding support for the Blob API: https://ideas.simplifier.io/
You must be logged in to reply to this topic.