Category: Widget
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Filepicker File Dynamic Preview

Issue

I am wondering if there is a way to preview files that I upload in Filepicker. I'm hoping to be able to see a preview of the file before I fully upload it.

Resolution

The files uploaded in the FilePicker widget can be previewed using the appropriate widget, for example, using the Document Viewer, the Image widget, or the Video widget. First, you need to check the file extension and, based on that, show or hide the widgets as needed. If the uploaded file is an image, it can be opened with the Image widget, while other file types, such as PDF or docx, can be opened with the Document Viewer, and videos can be viewed in the Video widget.

We have a sample app that demonstrates how to display an asset using its URL, but it can be adapted to this use case.

Overall, this solution allows for a more dynamic and efficient way to preview uploaded files in FilePicker, based on their specific file type.