Home > Software engineering >  Can I send a Image to whatsApp using html hyperlink / a tag?
Can I send a Image to whatsApp using html hyperlink / a tag?

Time:02-08

we can send text using html a tag with the following code

<a href="whatsapp://send?text=Hello World!">Hello, world!</a>

or

<a href="https://web.whatsapp.com/send?text=Hello World!">Hello, World!</a>

now If I want to send a Image attachment , how can do that?

CodePudding user response:

I guess it would be like this if you are trying to create an image which acts like a link

<a href="https://web.whatsapp.com/send?text=Hello World!"><img src="myCoolImage.png" width="500" height="500"></a>

CodePudding user response:

U can't. The closest to it would be to send a link in the message that has a image preview, but that's not that usefull. I'm guessing this wouldn't even be possible to add in whatsapp because to access a user file like an image I believe this has to be done with a direct user interaction (like manually selecting the image), but not by clicking a link, just by doing that whatsapp can't get the image from user storage.

  •  Tags:  
  • Related