Click here to Skip to main content
15,891,905 members
Articles / Programming Languages / C++
Article

Code to download a remote file from a valid URL using URLDownloadCacheFile function.

Rate me:
Please Sign up or sign in to vote.
1.38/5 (4 votes)
18 Oct 2001 105K   2K   18   7
You can use this code to download a remote file from a valid URL using URLDownloadCacheFile function.

Introduction

You can use this code to download a remote file from a valid URL using URLDownloadCacheFile function. The demo shows that get a .gif file and load it into memory (i get it's BITMAP struct). URLDownloadCacheFile function download a file from a URL and save the file in IE temp folder, so when you use CreateFile function,you must use FILE_FLAG_RANDOM_ACCESS flag,otherwise you will failed to createfile. You can also use URLDownloadFile to get a remote file,if you use this function,you need not care about the flag about the CreateFile function. Another good way to get remote file is socked,it can control the process,so cool! If you have intersting in socked,try it!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
China China
I love program!

Comments and Discussions

 
General[Message Deleted] Pin
22-Oct-01 11:45
suss22-Oct-01 11:45 
GeneralRe: poor writing skills Pin
Christian Graus22-Oct-01 12:09
protectorChristian Graus22-Oct-01 12:09 
Two observations

1. People who don't even register to the site have no right to comment on articles or anything else here as far as I am concerned.

2. The meaning of the term 'unedited reader contribution' is that this person uploaded an article without it going through anyone at CP.

I would agree that the article is a little on the brief side, and I've not looked at the code to see if it is useful ( I don't do ASP ), but if you're too much of a pussy to put your name to your posts, you should not presume to criticise others.


Christian

As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.

Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
GeneralRe: poor writing skills Pin
Member 77399118-Dec-03 17:56
Member 77399118-Dec-03 17:56 
GeneralRe: poor writing skills Pin
Christian Graus23-Oct-05 12:09
protectorChristian Graus23-Oct-05 12:09 
GeneralRe: poor writing skills Pin
Anonymous20-Oct-05 18:40
Anonymous20-Oct-05 18:40 
GeneralRe: poor writing skills Pin
Christian Graus23-Oct-05 12:10
protectorChristian Graus23-Oct-05 12:10 
GeneralRe: poor writing skills Pin
Kurt Farrar21-Dec-05 4:07
Kurt Farrar21-Dec-05 4:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.