Upload html file and view

Hi…
How can I upload a few jpegs and an html file to a folder in my jmix project. I do not want to invoke a download. I want to view that html in a new tab.?

Thank you

Hi,

In order to upload a file into a file storage, the FileStorageUploadField component can be used (see docs for more detail).

The jmix.ui.viewFileExtensions app property defines which file extension are shown in the new browser tab instead of be downloaded. This property is taken into account by the Downloader bean - a generic interface to download data from the system. This bean is also used by the FileStorageUploadField component when clicking on the file name:

Screenshot 2022-03-14 at 11.35.42

Regards,
Gleb

Thank you for your response gaspadin Gorelov.
i dont wish to invoke a download,

I want to upload something that can later be viewed in the browser like an html with images
upload html with 2 photos
navigate to
www.mysuperjmixapp.com/reports/uuid/report.html

I got that, but as I mentioned above, the Downloader bean taken into account the jmix.ui.viewFileExtensions property, so it shows files in the new browser tab if their extension is in the list.

Alternatively, take a look at io.jmix.ui.download.DownloaderImpl#download(DownloadDataProvider, String, DownloadFormat) implementation and how JmixFileDownloader is used to display files.

Regards,
Gleb