nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.64k stars 3.99k forks source link

Share images or videos via the Share Menu on mobile (browser) to save directly to the gallery #46511

Open schlagmichdoch opened 1 month ago

schlagmichdoch commented 1 month ago

How to use GitHub

Is your feature request related to a problem? Please describe. When receiving files via a link and opening it on a browser on mobile (iOS Safari in my case), I’d like to be able to save files in original quality to my camera roll easily. Right now I have to tap on:

  1. Tap Download File
  2. Show
  3. Long tap the shown image to activate the context menu
  4. Tap save to gallery

Most users do not know of this workaround as it is rather unintuitive. Probably, they would rather use the download button and then be confused that the images are saved to the download directory when they actually want them in the gallery.

Describe the solution you'd like Modern browsers natively support sharing files via the native share menu via JavaScript. I’d like to have a button or context menu to share the image in high quality via the share menu. In the share menu there is an option to save to the gallery:

  1. Tap Share
  2. Tap Save Image to Gallery

This would be especially helpful when saving multiple images or all images:

  1. Mark all
  2. Tap Share
  3. Tap Save Image to Gallery

If you do not want to add another button, for media files the Download button could activate the share menu instead of downloading directly as it includes an entry „Save to files“ and „Save to gallery“.

Documentation: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share

Example (tap Share Image button): https://benkaiser.github.io/web-share-images/?ref=benkaiser.dev#/image

Additional Context

Beware that AFAIK the files are loaded into RAM when using the share menu which could crash the page if not done right. Maybe an upper file size would work.

schlagmichdoch commented 1 month ago

Although it’s prefer this to be natively supported, I guess someone could also write a plugin for that functionality. As a starting point I‘d use this: https://github.com/major-mayer/imageconverter