chungchunwang / Budibase-File-Repeater

MIT License
6 stars 2 forks source link

Unable to view files #5

Closed apparentlyjeff closed 1 year ago

apparentlyjeff commented 1 year ago

I've set up the file uploader and it works fine and displays the attachments I've uploaded when editing through the form. But when placing this component into my budibase app, it just remains blank. I see no file name and no indication of any attachment whatsoever. If I change the data in the underlying field, the component does display a JS error, so it's reading the data, but for some reason it's not displaying anything.

chungchunwang commented 1 year ago

Hi! Could you please provide me with a few screenshots of the issue? It would better help me diagnose this. A few fixes I can think of are:

apparentlyjeff commented 1 year ago

Form to upload attachments. Seems to work... image image

Page to display results and attachments. I added a paragraph that displays the attachment field to be sure data was getting through. image image

And I've manually editted the data stored in the field, which results in the output displaying an error, so I know it's reading the data. image

chungchunwang commented 1 year ago

Hi! This plugin works a bit like Budibase's Repeater component. Given data for a particular file field, it merely repeats its children for each file in the field. It is up to the children of the repeater component to display the data. The children of the file repeater component gain access to the additional fields: data URL, blob URL, name, size, type properties.

See the third image of the How To Use section for an example of this.

chungchunwang commented 1 year ago

What you would need to do here is to add a Link component as a child of the File Repeater component. Then set the name property of the Link component to the name of the file (provided as a binding by the File Repeater), and the URL component to the blob URL of the file (also provided as a binding).

chungchunwang commented 1 year ago

The How To Use section gives a pretty good walkthrough of how to use the component. Try checking it out!

apparentlyjeff commented 1 year ago

Thanks. I'm obviously dense. I thought I read the instructions, and now what you've said makes perfect sense.