Let’s say I have a data table of media objects (containing jpg’s). I am displaying these in a repeating panel with a download icon. When the user hits download, I would like to download the file, but with a different name than what is stored in my data table (even maybe letting the user choose the name).
I thought there might be something simple like
anvil.media.download(self.item['image'], name = 'name.jpg')
However, the solution seems to be eluding me. I have also tried
self.image = self.item['image']
print(self.image.name)
self.image.name = 'name.jpg'
print(self.image.name)
anvil.media.download(self.image)
but both print's yield the same result (the name of the data table file). Then, I tried to play around with some of @stucork’s suggestions in Export table with Media column? but still couldn’t get anything working.
Does anyone have any quick solutions or hints or references?