Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

opening an image from browser to gallery

I'm working on a mobile site and designing a sliding gallery which has Images & Videos. If I click on video, it open in Youtube and works fine. Here is the code I use.

<a href="http://www.youtube.com/v/YouTubeID?version=3&hl=en_US">
<img class="sliderImage" src="http://img.youtube.com/vi/YouTubeID/0.jpg" alt="Video" />
</a>

i want similar functionality with images so that it gets open in the Default Image Gallery like Android Image Gallery, Windows Mobile Photo Viewer etc as per the mobile device.

Here is the code

<a href="Some Image URL">
<img class="sliderImage" src="Some Image URL" alt="It's Better" />
</a>

I think, there is something needed in href to redirect the image to gallery but I do not know what that could be.

It would be really helpful if someone can point me in right direction.

Thanks in advance.

like image 570
Jitendra Khatri Avatar asked Nov 03 '22 13:11

Jitendra Khatri


1 Answers

One way to do it is to set the image's mimetype to a value that is by default downloaded, such as application/octet-stream.

If you can't access the file to change the mimetype, you can just change the mimetype of the HTTP response (PHP example)

The post is talking about MP3's, but the method works for images as well.

like image 142
NH. Avatar answered Nov 08 '22 09:11

NH.