This is the situation: I have a database wich contains medical information about the patients of a clinic. A table of the database has a BLOB field for any kind of relevant document about the patient: X-ray images, previous medical histories in (let's say) PDF format... you name it. I know that the use BLOBs to store files is controversial, but the data protection laws in my country force to do it that way, so that's not really the point this time. I'm comfortable storing files in BLOBs anyway.

The same data protection laws that force the use of BLOBs also demand to avoid as far as possible the use of temporary files. That makes sense, but also causes an issue when the time comes to view the files stored in the BLOB. I have no problem showing the files if they are images, since I can easily create an image viewer; but if the file is anything different, like a .docx file, and I don't want to create a file viewer for any known file type, the easy way is to open the file with the default system application. It's not a big deal with QDesktopServices and QUrl, but can it be done without creating a temporary file?

My first tought was that it's impossible; if the file only exists in the app memory, no other generic (not necessarily Qt) application can access that memory to open the file. Anyway I have read the documentation for QSharedMemory, QUrl, QFile, QBuffer and anything remotely related to the issue, and I keep thinking that the answer is still no, it can't be done without creating a temporary file.

So my question is simple: am I right, or have I overlooked some possible solution?