How to show non downloadable image in django - html

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.

Related

Does it matter how the background image is chosen in a folder?

I'm wondering if it matters when you save an image in a folder, like when you right click on an image, Do you choose:"Save link as" or "save image as" as I have tried both but for some reason I cannot display the image as my background for a website. Is there anything wrong with the code that I did? Every time I drag the URL into a new tab or browser I only get 6 bullet points on a blank page.
I mainly used an external CSS sheet, then decided to try to fix it by using an internal sheet on HTML, and since that did not work, instead I tried to implement it in the body tag rather than the header tag but nothing worked. Would I have to use the tag? But how else will I be able to implement a background?
file:///Users/kevinnguyen/Desktop/Screen%20Shot%202019-01-26%20at%2011.09.11%20PM.png
The one above is the HTML file.
file:///Users/kevinnguyen/Desktop/Screen%20Shot%202019-01-26%20at%2011.12.19%20PM.png
this is the external file of CSS.
I'm a new to programming as I self taught myself the basics, yet I want to learn so much of it, it's thrilling.
Your links to the images don't work because they point to files on your computer. You need to upload them somewhere and put the link here to be able to see them. Anyway, if you have background-image:url("6928140-swiss-alps.jpg") your image should be in the same folder as the css file. And it should be called 6928140-swiss-alps with the .jpg extension at the end.

Is any image link suitable for suitable for adding in html file?

I know I can add images to a html file by the following syntax
<img src="*****">
But my question is can i copy any images link from the web and add them to my html file?
i'm not talking about the copyright laws regarding this, just, can every image link be used as the image source in html?
I was writing a code in codepen where i embedded a link to an image from devianart, but the image didn't show up.
I think it depends to the website policy; Some websites don't let you to use their hosted images in your webpage, and some others do.
this is what i find on W3schools:
Definition and Usage:
The required src attribute specifies the URL of the image.
Note: When a web page loads; it is the browser, at that moment, that gets the image from a web server and inserts it into the page. Therefore, make sure that the image actually stay in the same spot in relation to the web page, otherwise your visitors will get a broken link icon. The broken link icon is shown if the browser cannot find the image.
The URL of the image.
Possible values:
An absolute URL - points to another web site (like
src="http://www.example.com/image.gif")
A relative URL - points to a file within a web site (like
src="image.gif")
Hope this is helpful :)
make sure image fully open in your browser tab/
i also check it but it work in codepen may be you doing something wrong first need to write clear what you want
try this image tag in codepen

Background image not showing up unless it directly visited and cached by the browser

I have a strange issue with a particular image URL.
First of all please visit this page with your clean cache (it's an under development Reddit clone in Turkish language, anyway...)
So, the thumbnail image didn't show up right? Nothing, just whitespace right? I mean no thumbnail image unlike this page right?
This is how we are loading the thumbnail image:
<div class="link-thumbnail" style="background-image: url('http://www.herkesebilimteknoloji.com/wp-content/uploads/2017/01/dunya.png');"></div>
Now please visit the image directly with your browser and return back to the problematic page. This time image showed up right?
Eventually my conclusion is; background image is not showing up unless it directly visited and cached by the browser.
So what is the mechanism/reason behind this? As you can imagine by just looking to URL, image's host is a WordPress site. So what could be the trick to prevent this image to load by background-image: url('...') By the way it's loading the image perfectly with <img> tag.
I know some wallpaper web sites doing similar trick but none of them were giving away the image directly without doing a redirection trick. I believe this case is not similar.
And last but not least; how can I handle such a case when using background-image ?
You are loading this image from a different URL / wordpress system. It seems like Wordpress itself prevents images within its "file system" to be loaded as background images from other URLs.
But you can just save that image, put it on your own site and load it from there.

Why can't I change background image of my HTML site?

I have developed a simple ASP.NET website; I have written a simple CSS to show a background image for that, but when I want to change the background image, the website shows the same image; did the ASP.NET cache the image?
The background image is banner.jpg and shows a picture, but I want to change that picture and another file replaces banner.jpg; the website shows the last picture.
sounds like an unwanted image cache. do a hard refresh after replacing the image file by pressing ctrl + F5 and it should pull from the replaced image file

Why IMG load everytime when refresh the web page?

I have one html page which contains background images + one logo (image). I called background-images through external css file, but for the logo, i used with an <image> tag. Whenever I refresh the page, the logo image is always reloaded but not the background images are. Can i know why the image reload every time ? Do i need to use that logo image as background-image as well ? Any suggestion please.
Your webserver should return headers to assist client-side caching. They are not doing that by default. Google for mod_expire if you are under Apache.