yuuvis® RAD Q&A

0 votes
by (340 points)

Hello,

in the assets of our client we have a .wasm-file. It should be delivered as 'application/wasm', but it is delivered to the browser as 'application/octet-stream'.
Where can this be changed?
A mime-entry in the web.xml of the rendition-service didn`t change anything.

Best,
Stefan

2 Answers

0 votes
by (16.8k points)

Hi Stefan,

never heard about wasm files before. Is it right that it is a text file with a programming language syntax. How do you expect the preview should handle such files?

Currently, our mimetype analyser is not aware of this format so you have to send a change request to pm[at]optimal-systems.de to get this solved in the future.

Version 9.0 is coming with a new viewer service that is potentially extendable by your own so that you can add a component that should handle the viewing for this file.

This viewing service has added the monaco editor that covers some programming languages. Maybe that we can use this one for your requirements.

Best Regards,
Martin

ago by (340 points)
Hello Martin,

we do not want to view the wasm-file. It is part of a custom viewer. The problem is, the yuuvis web server (tomcat?) does not send it with the correct mime.

Hope it is more clear now.

Best,
Stefan
0 votes
ago by (3.3k points)

Hello,
the Yuuvis RAD system stores the mimetype that is given by the client. Only if the uploading client does not provide a mime type, or just provides application/octet-stream, the mime type is determined by a mapping of file extensions to mime type list, that is kept on server side.

By uploading content while providing the mime type, this mime type gets stored. For an api client it can be set by providing a 'Content-Type' http header. A browser sends (in most cases) the Content-Type header according to the OS settings. In windows it is possible to add a custom mimetype mapping in the CLASSES registry.
Example for WebAssembly files:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.wasm]
@="WebAssembly"
"Content Type"="application/wasm"

By importing this win registry entry on the client machine, a uploaded wasm file, will get the content type application/wasm.

The other way to solve this problem, is to adjust the server extension to mimetype mapping. This is done by editing the jas-systemmimetypes.xml file in the configuration folder. Advantage: No need to change an individual client - Disadvantage: Core-Service restart is necessary to get the configuration active. After Update/New installation this configuration has to be done again.

Hope this helps.

ago by (340 points)
Hello klingebiel,

the wasm-file ist NOT content, it is NOT stored inside the RAD system, there is NO uploading client. It is part of a custom viewer inside our custom webclient.
To be clear: It is a part of the bundle of the yuuvis webclient.
It is not some document or whatever "inside" yuuvis.

Best,
Stefan
ago by (3.3k points)
Ok - complete misunderstanding here - missed your first sentence.

I assume your custom client served as a resource from the service-manager data directory (service-manager\webresource\public).
If this is the case, your are usinf the clientservice as the server for your files - in this case, the wasm Type should already be part of the default MimeMapping provided by spring-web defaults.
See here : https://github.com/spring-projects/spring-boot/blame/main/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java
A quick test on our 8.16 test system, showed that this is working - sadly this is not the case for the 5.5.0 version of the clientservice that is provided with the 7.16 yuuvis RAD version.

What is the version you are currently using? And is it true, that you are using the webresource folder for your custom client?
ago by (340 points)
Yes, we`re using the webresources folder. Currently, we are at v7.16
ago by (3.3k points)
The mime-mapping in a spring boot web application are not easy configurable. I see 3 possible ways to solve this Problem:
- Upgrade to 8.16 LTS - wasm is by default mapped there.
- Use your own Webserver for serving static files. Can be any implementation. It must just be inserted in the routing configuration of the gateway.
- Ask PM for a change request to provide a possibility to configure the  mime-type mappings for version 7.16 LTS
...