开发者

retrieve the url of the page an image sits on

开发者 https://www.devze.com 2022-12-29 05:33 出处:网络
I\'m trying to log URLs that access broken images, using an HTTP module to catch those images when accessed.

I'm trying to log URLs that access broken images, using an HTTP module to catch those images when accessed.

How do you retrieve the URL where that image sits on? is there a way to do it the other way round too? That is, loop through images served in a URL and decide which ones are broken.

This is all in ASP.NET with C#.开发者_如何学Python


You should be able to work out what page requested a broken image by checking the Http Referrer (Request.UrlReferrer) in your HTTP Module when you detect the 404.

Doing it the other way around would be much more complicated since you'd have to parse the outgoing HTML.

0

精彩评论

暂无评论...
验证码 换一张
取 消