Hellooo - so I have some files uploaded to retool storage. I've recorded the file ids (the uuids) in a separate database. Is there some javascript that would convert a fileId to a url so people can view or download these files? These files are likely to be docs or pdfs.
Thanks!
1 Like
Not yet but we expect to support this by mid-late January! Thanks for the feedback
2 Likes
Thanks - for others, I ended up making a button to download the files instead
window.downloadingFile = item.fileId;
DownloadFile.trigger({
onSuccess(file) {
utils.downloadFile({base64Binary: file.base64Data} , file.name);
}
});
I wanted to use additionalScope
here, but i wasn't able to access it in the Retool Storage Query.
Here's what the DownloadFile query looks like:
1 Like
Tess
December 8, 2023, 6:48pm
4
Thanks so much for sharing @parrisfvci !
Heads up: we now have URLs supported. See here
Paulo
August 20, 2024, 10:14pm
7
This syntax does not work anymore:
let file = query2.data
utils.downloadFile({base64Binary: file.base64Data}, "cat", "jpeg")
// won't work
Instead, take this approach:
let file = query2.data
utils.downloadFile(file.base64Data, "cat", "jpeg")
// works like a charm!