Solved

How to preview multiple files that are stored in a table?

  • 1 September 2022
  • 2 replies
  • 58 views

Userlevel 2
Badge +3

Hello all,

The preview component works well, but it grabs the first file that it encounters in a table row. However, we have two files in a table row. Let's say, we have a proof of purchase, and a discount voucher. Both are obtained through an API call, stored as Base64 and converted back to their binary form after insert. The binary file is stored in the proper storage column linked to the file/filename field. This works flawlessly.

We only get to see the first file, though. The second file is simply ignored. How do we display both files?

Best regards,
- Alex

icon

Best answer by Alex Kerschkamp 16 September 2022, 09:47

View original

This topic has been closed for comments

2 replies

Userlevel 2
Badge +3

Thanks Freddy! We've been playing with ideas. The options you provided didn't quite fit our needs. We ended up storing the files in a separate table. This way, we can preview one file at a time.

Userlevel 5
Badge +16

You could achieve this is to make 2 variants each with the file you want to see as first column. 

Or make a view on top of that table and use the unpivot function to make columns into rows so every row has only one document and thus will be shown.