-
May 2nd, 2001, 08:37 AM
#1
CHttpConnection and downloading images
I am using the CHttpconnection and CInternetfile classes, and am successfully able to retrieve web pages and also download images. However, here is my problem:
Some web sites make it so that if you type in the url like http://lala.com/image.gif they will redirect you to their homepage instead of just loading the image by itself. A security feature I suppose. In my code, I parse a web page to grab any image links, and then individually attempt to access each image link, so you can see how the above rule is a problem for me.
My questions is, Internet Explorer is able to get around this somehow. Since IE shows you a web page and loads all the images in it too. So how does IE get the images without loading a seperate url for each image, and how can I get around that security feature described above if I am using CHttpConnection?
Easy Internet Software @
http://www.DummySoftware.com
-
May 2nd, 2001, 08:48 AM
#2
Re: CHttpConnection and downloading images
An idea would be to look at the HTTP specification to see if there are different requests to retrieve content on a page than to retrieve the page itself.
Martin Lippert
http://www.silhouette.co.za
-
May 2nd, 2001, 09:18 AM
#3
Re: CHttpConnection and downloading images
Hey, good idea. I looked up the protocol details and there is an optional field in the header like this:
Referer: http://www.w3.org/hypertext/DataSources/Overview.html
Which looks like what I need. You have to let the server know you are downloading the images from viewing its html page. I did not have that field in my header so the servers would assume I was blindly trying to access an image. Thanks.
Easy Internet Software @
http://www.DummySoftware.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|