How to Download a File

What is the correct way to download a file that has been uploaded to a Tulip table?
I have tried the following methods but all have issues:

  • Inserting a file input widget that references a variable that stores a file from a table via a embedded table trigger. You then block off the upload button on the widget with some shape. If the user clicks on the blue text of the filename in the widget, they can download the file. This is the most promising solution currently. Issues: this only works for non image files. Images will just pop up in another player window. Additionally, the user can click in the text box but outside of the blue text link and accidentally edit the URL.
  • Insert a table record widget. Issues: If it is an image or a pdf, that will simply display inside the player with no way to download. If it is a csv (and maybe other file types) it can be downloaded.
  • Go to tulip table and download. Works from a data access point of view, but not feasible for wide access.

I imagine I could create a standalone program and use the API to browse and download files but that’s a bit of a project.

I believe I have tried basically everything in this article: Product Docs Template Except the first example looks like it’s using some other type of widget I can’t quite pin down.

Any advice is appreciated! Thanks!

@TechnicallyKatie, I know you’re working through this issue right now. Do you have some good perspective on this?

Not yet. I can get my pdfs to download by clicking on the file name inside the table record widget. My problem is getting the PDF to display automatically after that, and to do that I think I need to work with authentication in Connectors like we discussed in Office Hours yesterday.

Ethan: I think you can create an easy “browse and download” step with 2 objects: An embedded table, and the File input widget with the “upload” button covered up as you described (never considered that, great idea). If the File Input widget and the embedded table are connected to the same record placeholder, then the file link will change depending on the row selected in the table.

Yeah I think that is the best option currently outside of a custom widget, but I don’t have JS skills, so it’s what we’re going with!