Display binary data on modal
Question

Hi, guys!

I have a page where some attachments (they can be image or pdf) are listed and there is an option to download each one, but I was requested to make this files visible in a modal, so that the user will avoid downloading it every time, because sometimes they just want to visualize it quickly.

Currently I already have a modal and I'm trying to display the attachments into it whit list records, but it appears that binary data is not allowed on this component.

Does someone know how to achieve this?


Regards,

Eduardo

mvp_badge
MVP
Solution

Hi Eduardo,

See the example .OML in attachment.


Result (show PDF and image in modal):

Regards.

ExampleModalShowFile.oml

mvp_badge
MVP

database image:

Thank you, Agno! I'll study and try it.

Hi, Agno!

I'm trying to make it work, but it seems that I don't have this PDF_JS component, and I couldn't find it in the Forge. It looks like some parts are missing. I've searched for PDF_JS, but didn't find.


Best regards,

Eduardo

missing.png

mvp_badge
MVP

Hello,

You do not need to use the component, you can use the iframe directly from the tools tab

New version without PDF_JS  in attachment.

If you still can't, send me your .OML for check.

Regards.

ExampleModalShowFile.oml

Hi, Agno.

Unfortunatelly, no. Iframe seems not to be available to me.

Is there something to do with using a web block? I can't use a web screen, because the structure was previously built in this web block. I was meant only to improve it with this visualization.


Best regards,

Eduardo


Ps.: There is an screenshot with a search by Iframe.

NoIframe.png

mvp_badge
MVP

Right, it's possible use in webBlock and screen,

try get the Iframe in your references:

or

Regards.

Got it, Agno!

It's working!

Thank you so much!


Best regards,

Eduardo

mvp_badge
MVP

Hello Eduardo, 

Possibly this component can help you.

Best regards, 

Paulo Z

Thank you, Paulo, but I forgot to mention that it is a web app. Sorry.

@Eduardo Coelho The question might be already answered, but I suggest don't store the files directly in the database, it's not bad if you only storing a few files or depending on the requirements, but if the requirement is store a lot of files, thousands of it, then it will be get bad in the future.


Try to save it on cloud storage like S3

- Generate a public path then save it to your database/table


Please read this about storing files on the database.


Cheers, mate.



Hi, Jovvy!


I'll hand on this to my superior. Many thanks!


Best regards,

Eduardo

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.