Framing preview

I want to ask the forum if it is possible to present in WEB2 a preview of a document inserted into PostgreSQL.

I have seen that many applications can present a small glimpse of formats like word, pdf, or even images.

If this is possible, how does XOJO develop?

I once Zipped and BinHex’ed a file then placed it into a PostgreSQL TEXT field. I added it to the field through a series of append commands, in case the file was very large.

It is not desirable for many reasons (eg database is HUGE, backups very slow, a crash takes down everything), so I have moved to storing the files beside the database (eg AWS Bucket, FTP or CubeSQL FILE UPLOAD …).

My experience has been just the opposite.
PostgreSQL has shown me very reliability and stable.

Other databases have a similar capacity to PostgreSQL.

PostgreSQL uses a separate database called the Large Object module.

What you mention, it is not advisable to do it.

And what dows that have to do with the question?

Well, you have to extract the document to a temp file, and use a custom control to show it in the web app, something like PDF.js

To clarify. I am looking for is to view a frame into a web page where you can see a preview of the content of a file.

Whatever the format it contains.

I don’t know if this is possible.

What @Ivan_Tellez posted would be the way I would go around doing something like you are attempting to do

So is the PDF file inside a field of the PostgreSQL table or not? We seem to be trying to solve two issues here: can you store a PDF file INSIDE your database and can you display a PDF within a Web2 iFrame. Which needs to be solved, one or both?

David, I want to present a small iframe. And I can preview a file saved into the database.

Extracting the file is not a problem.

The problem is showing this content in an iframe. Regardless it has a Jpg, Bmp, Xls, Doc, Pdf extension, among others.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.