I came across the features of IIS and it notes that I ca开发者_Go百科n prevent inline linking or leeching. How can I implement such a rule?
You will need to use URL rewrite to point to a resource within a web application that will be able to identify the refferer before displaying the resource to the client which called the application.
IE, rewrite the following /images/myPhoto.JPG to /getResource.PHP?resource=%2Fimages%2FmyPhoto.JPG
Then inside getResource.PHP forgive me if this isn't quite right, my php is a little sketchy, but you get the idea
header('Content-Type: image/jpeg');
if(isset($_SERVER['HTTP_REFERER'])) {
    if( /*test that it fits your criteria*/ true ) {
        $imagepath= $_GET['resource'];
    } else {
        $imagepath= "/images/stopLeaching.JPG";
    }
} else {
    $imagepath= $_GET['resource'];
}
$image=imagecreatefromjpeg($imagepath);
imagejpeg($image);
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论