I need users to download an image from my web app. For browsers that support the HTML 5 'download' attribute my Download button automatically opens the browser download window. However, users on the remaining browsers need to download the image the old fashioned way.
To save an image from a browser on a non-touch device, one right clicks and selects "Save Image As..." and on a touch device, one can usually tap and hold the image and select the save image option.
What concise message/instruction will tell the user to perform the above mentioned actions to download the image? Since we cannot tell with 100% accuracy what device a user is using we would need a combined message (handling touch and non-touch devices)? Though seems that might be unwieldy and long.
Also is asking user's to "right click" on OSX valid? While there are a number of ways to right click, for the average OSX user, is it something one can expect knowledge of?
Content-Type: application/octet-streamHTTP header to force most browsers to download it.
Content-Type: application/octet-stream. You should also make the URL end with filename and extension. Example implementation in node.js (Express framework) ----------------------------------------------------- Serves images stored in directory
photo-<number>.jpg. Serves them on the same path (
http://127.1/images/photo-42.jpg). ```js const express = require('express') const fs = require('fs') const path = require('path') const app = express() const imageDir = path.resolve(__dirname, "images") app.get('/image/:filename', (req, res, next) =