Give hyperlink to download image without image name - html

I am using QR code API from this website. It generates QR code image from the URL input we give to it. For example, I am showing the QRCode of data 'abcd' on my website by adding an <img> tag of src=https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=abcd. This shows the QR on screen, but I also want to give a download link to that image. Suppose if a user clicks on that image, it should get downloaded. How to do that? I am confused because the image is getting generated dynamically and I dont have a name or specific url to it.

Related

Twitter t.co links is not fetching images

t.co of twitter is not fetching images. After redirecting to another link it is unable to fetch the images.
my code is:
<pre>
<img class="imgmyclass" src="https://t.co/onj4Gps4rQ">
</pre>
please help.
Thanks
Because the url does not point to an image.
As far as the image in the link you are trying to extract the image from is concerned, use this:
<img class="imgmyclass" src="https://pbs.twimg.com/media/CZ4p4TCUAAEQKJt.jpg">
Where src tag is used to point to an image, not the url of a page which contains a post and an image associated with it.
If you want to extract the image url, open the html page, right click on the image and hit copy link address. Do not forget to Give proper credits to the owner of the image.

How to retrive image from image path in MySQL databse table using jsp?

I want to display the image on a jsp. I have the image path in the MySQL table where the image is uploaded or stored. Using that image path how can I display the image on the JSP?. Can anyone show me the code for the same?
You get your jsp to emit an image tag.
For example, if your imagepath column contains /assets/2015/abc123.jpg, you arrange for the web page your jsp is serving to contain a tag like this:
<img src="//static.example.com/assets/2015/abc123.jpg">
Then, when the browser goes to render the page your jsp sent out, it will fetch the image from the path.
Now, I am guessing at the rules you need to follow to turn the path in your column into a valid URL. The business about //static.example.com/ is my guess. But that is the basic idea.
Suppose there is an image stored in database as images/triangle.gif and in your project there is an image name triangle.gif under web/images folder. Then you can simply show the image like this.
<img src="${pageContext.request.contextPath}/images/triangle.gif">

Image not being retrieved from Dropbox

Hi!
I have an image slider. When I try toe retrieve the images from my server, the images are properly displayed. (http://stthomasmountmtc.org/index.html)
However, when I try to retrieve the same images from Dropbox, the images are not displayed/retrieved. (http://stthomasmountmtc.org/index1.html)
<img src="https://www.dropbox.com/s/woart55urbw792u/image1.jpg" alt="image" />
When I open the link in the src attribute in the browser, the images can be seen, so the link is obviously not broken. Please share your suggestions.
Thanks,
Samuel Mathews.
The link in your code opens the gallery feature of Dropbox, which is a HTML webpage, not an image file. The direct link for that image is:
https://dl.dropboxusercontent.com/s/woart55urbw792u/image1.jpg
You should always set the source of an image tag in HTML to an URL which outputs an image - and not a webpage containing an image.
Another option to view a Dropbox image directly is to access the Dropbox link using the ?raw=1 parameter.
For example, if the Dropbox link is:
https://www.dropbox.com/s/83dcx4efx791s2i/stackoverflow.png?dl=0
change the ?dl=0 to ?raw=1, such as:
https://www.dropbox.com/s/83dcx4efx791s2i/stackoverflow.png?raw=1
Note that using "?dl=1" (instead of dl=0) will download the image.
Reference: https://www.dropbox.com/help/201
I was able to get this to work while trying to address a similar problem by logging into Dropbox, viewing the image itself, right clicking on the image and selecting "Copy Image Address".

How to show non downloadable image in django

I have created a form in django project which contains an image field and i did the image upload and retrieving the image to webpage successfully but one more thing i have to do is to make the image non downloadable. I did that by making the image as background image of a div element using css. But still the image can be downloadable by viewing the page source and using the url of the image.
Is there any other way to make the image non downloadable?
If you want to server an image to the browser is impossible for the image to not be downloadable? How would the browser interpret the contents if it cannot access them?
If you want the image to not be usable maybe add a watermark to it.
Lets say you could do that. Display the image but won't be downloadable. But in that case the user could just make a print screen and cut the image out of it.
You can't do that, the browser implicitly is downloading the image to show it, if you make an image not downloadable, it means that it is not accessible so it won't be displayed. If you want to make it difficult for the user to save it, you can disable the right click in the image so the user can't do something like inspect element in chrome having to look for the image in the source code. As I've said, this is not the solution because there isn't.

monotouch: Image not displaying in email

I have some html that has an image in a table. The table displays fine in a UIWebView. I take that same html and send it in an email (using MFMailComposeViewController). The code snippet to build the html is:
html += "<tr><td><img src=\"reading.png\" align=left></td><td>"
The table is created properly, but the image just has a question mark in a blue box. (Obviously, it can't find the image, but why?)
How do I fix this?
The path "reading.png" is not found, that is the reason why you do not see the image.
There are in fact several potential solutions.
1) put the image to the web URL something like http://yourweb address.com/reading.png, this works well and will show, all the clients supports this and user just need to click to "show images" if he/she has it disabled by default in the email client.
2) second solution is to put the specific image representation to the img tag, you can do so by opening the file, reading its content and adding it as base64 data to the src of the img, there are plenty of samples for this.
3) third is to add it as attachment to the email. Again plenty of samples here and on the web how to do that.
Conversion of the sample code from ObjectiveC is simple to Monotouch.
Hope this helps.