0

Denar All! I tried to add to my mail download attribute to download a picture to recipient pc/cell Phone, (right Click, inspect code, Edit html), and it accepts simple codes to "play with", but it just ignores 3 line w3schools code with download attribute. Do I Use the wrong pc or wrong doma in and what should it be like?

Just to add, I tried both options: with an internet photo/seems this would not work either, and with the picture from my own pc. For easy peasy code no result at all, makes me already desperated, is anyone willing to help, thanks in advance!

Using Chrome 84

Ann Ran
  • 1
  • 2

1 Answers1

0

This is most likely a cross-domain or local resource issue. You can verify this by going to DevTools (Menu -> More Tools -> Developer Tools) and checking for errors in the Developer Console.

Try running a server locally, hosting an html page and image, and pointing the image to the URL that this server is also hosting. Here is one way to do it:

  1. Install node

  2. Node.js quick file server (static files over HTTP)

  3. Within that folder set up the following folder structure:

    directory

    • index.html

    • image.jpg

  4. Create index.html to have the code you want and point at "./image.jpg" with your w3 code like so: <a href="./image.jpg" download> <img src="./image.jpg" alt="W3Schools" width="104" height="142"> </a>

  5. Hit your locally running server and try again: http://localhost/index.html

abelito
  • 1,094
  • 1
  • 7
  • 18