-
Proxy Authentication error
Hello everyone,
I have a connection made to the internet :-
CInternetSession session;
session.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 1000);
session.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 3);
try
{
remoteFile = session.OpenURL(urlPath, 1 ,
INTERNET_FLAG_TRANSFER_BINARY |
INTERNET_FLAG_RELOAD |
INTERNET_OPEN_TYPE_DIRECT );
}
catch (CInternetException)
{
AfxMessageBox("Received Exception from OpenURL()");
// Handle exception
}
This all works fine, and then I wish to download the file using :-
if (remoteFile == NULL)
{
cout << "Error in OpenURL";
}
else
{
cout << "Ok in OpenURL";
// Read from file
while (nBytesRead = remoteFile->Read(inBuf, sizeof(inBuf)))
{
...
}
When I run the software at home all works fine and the file (Excel) is downloaded successfully.
However, at work I'm getting Proxy Authentication error, i.e. the software cannot go out through the gateway.
The Windows Administrator tells me that if I can type the URL in IE browser and a pop-up comes up with Save As, Open etc, and later the file is downloading, then it must be my process. However, as I said this works at home ok.
Also, I should mention that when I use the same process at work (or home) to point to URLs ending with .html (obviously no dialog boxes appear), then all ok.
FYI: whether I try to download the file manually or using the automated process - in both cases I'm logged to the server as the same user who has permissions to download files from the Internet.
Any ideas what it might be ? Is OpenURL, or remoteFile->Read works differently from html to Excel files ?
Many thanks.
Last edited by ami; 09-06-2009 at 02:02 PM.
-
you need to also give your proxy username and proxy password to your call
CHttpConnection* GetHttpConnection(
LPCTSTR pstrServer,
INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
LPCTSTR pstrUserName = NULL,
LPCTSTR pstrPassword = NULL
);
http://msdn.microsoft.com/en-us/libr...8VS.80%29.aspx
Your browser might be configured to take this automatically...
DKyb-------------------------------
Life is a short warm moment -
Death is the long cold rest.
Pink Floyd
-------------------------------
Similar Threads
-
By vrijdag in forum VB Classic
Replies: 0
Last Post: 12-30-2006, 05:43 AM
-
By Khalizan in forum VB Classic
Replies: 1
Last Post: 11-28-2001, 01:32 AM
-
By Andrew McLellan in forum Java
Replies: 3
Last Post: 05-09-2001, 05:34 PM
-
By Chris.G in forum VB Classic
Replies: 4
Last Post: 11-13-2000, 03:16 PM
-
By Murray Foxcroft in forum Web
Replies: 5
Last Post: 11-02-2000, 02:42 AM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks