In my XPages application, users can upload images. At the moment, each image is thumbnailed and the thumb is then stored as an attachment to a single NotesDocument. In the browser, the thumbs are refered to by their Notes attachment url "[UNID]/$FILE/[ATTACHMENTNAME]".
To me it seems like a little "overkill" to have 1 document per image and I guess that this will also have an impact on the performance when a lot of image documents are in the same database, for example when creating view indices for views related to other documents. Hence, I want to ask if there is a better way to store images if you just want to show them in the frontend/browser and don't need to store any additional information about them.
I'd like to save the thumb files directly to a folder on the file system and then make that folder accessible via http(s). Yet, I don't know how to do this. I also thought about saving the thumbs to the WebContent folder, but I don't know about the drawbacks of using such an approach either. Does anyone have experience with this or can provide another solution for my problem?
I don't think you will be able to save them to the WebContent folder of the NSF and that would not be a good idea. It would save the images in the design, but the images should be data.
You may be able to save them to a folder under \domino\html, but again, that is not recommended. If you want clustering, the files will only be on one server; they won't have any security on them, so anyone will be able to access them; if there is any corruption, you'll have to restore; saving them may require higher access privileges; an admin may be unwilling to give you access to view them, so support will be harder.
My recommended solution would be to store them in a database. It can replicate and Domino can handle it accordingly. Plus you have all the relevant security out-of-the-box. With DAOS enabled on the database / server, they will not affect the physical size of the database.
The key is whether they are uploading just images or images + meta data or other data. E.g. if it's a Person document and they're uploading the profile picture. If this is the case, I'd store the image in that Person document. Because the image cannot be indexed for views, it's not affecting view indices, so that concern disappears.
If they have to be stored in a document on its own and you don't want it in the same database as the other data, create a separate database and store it there. Whether you're storing it in a separate database or in the file system, you need to store a relationship between them, so there's no reason to avoiod that approach. Plus you can still have the same security, use of DAOS etc.
In addition, you're likely to find much more support for how to do it, how to troubleshoot it etc, because very few applications or developers are likely to take the approach of storing on the file system when Domino is designed for and has a long history of storing attachments in documents (e.g. the Document Library template which has been around since I started with Domino 15 years ago).