What I’m trying to do:
I have created a gallery on my app which gets populated with images programmatically using link and image elements. images are served from a CDN.
What I’ve tried and what’s not working:
gallery and the images work fine.
problem is that the images are not downloadable(they are displayed as background) in mobile by click holding or on pc “save image as” does not appear on right click action.
I would very much appreciate if anyone can tell me how to make this work as it is essential to the app I am building.
I do not wish to have a button on the pop up to download because that downloads the image to the files and not to the photos unless I am missing something. This could be an option if anyone knows how to make sure a button from an alert will download images into photos app.
Code Sample:
# this is a formatted code snippet.
# paste your code between ```
for image in imgs[0:500]:
link = Link()
link.add_component(Image(source=URLMedia("https://*********.cloudfront.net/" + image), width=110, height=110))
link.tag = "https://*********.cloudfront.net/" + image
link.set_event_handler('click', self.link_click)
self.gallery.add_component(link, width=110)
def link_click(self, **event_args):
# print("CLICK~")
# test = event_args['sender']
# print(test.tag)
"""This method is called when the link is clicked"""
alert(
Image(source=URLMedia(event_args['sender'].tag), height=512),
buttons=[('Back', None, None)],
large=True,
)
Clone link:
share a copy of your app