Solved

c++ download file using custom proxy

Posted on 2010-11-22
4
522 Views
Last Modified: 2012-05-10
Hi Guys,

how can I download a file using URLDownloadToFile or something similar through a custom proxy server without having to set the proxy for Internet Explorer?

I would like to set the proxy only for this download without affecting another internet connection on the computer (ex. IE, ...)

Thank you,
0
Comment
Question by:xNejX
  • 2
  • 2
4 Comments
 

Author Comment

by:xNejX
ID: 34193068
i will settle for any solution that allows me to use a custom proxy independent from IE.
0
 
LVL 30

Accepted Solution

by:
Zoppo earned 500 total points
ID: 34195201
Hi xNejX,

I assume you want this to be done for Windows, right?

IMO you should be able to open an internet connection using a given proxy server address (thus ignoring IE proxy settings) using 'InternetOpen' with flag 'INTERNET_OPEN_TYPE_PROXY' - take a look here about more info: http://msdn.microsoft.com/en-us/library/aa385096%28VS.85%29.aspx

If this internet connection is established you should be able to download a file from there using 'InternetOpenUrl' (http://msdn.microsoft.com/en-us/library/aa385098%28v=VS.85%29.aspx) and download the file using 'InternetReadFile' (http://msdn.microsoft.com/en-us/library/aa385103%28v=VS.85%29.aspx)

Hope that helps,

ZOPPO
0
 

Author Closing Comment

by:xNejX
ID: 34196695
As always ZOPPO, like a charm :)
0
 
LVL 30

Expert Comment

by:Zoppo
ID: 34197178
:o)

Thanks ...
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
This is an explanation of a simple data model to help parse a JSON feed
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now