wininet

How can I prevent URLDownloadToFile from retrieving from the cache ?

I am using URLDownloadToFile to retrieve a file from a website. Subsequent calls return the original file rather than an updated version. I assume it is retrieving a cached version. ...

timeout error when on an ad hoc network

I am doing an InternetConnect (Wininet) to an FTP server that happens to be running on an iPhone. When the user is on a normal WiFi network it works fine for him. When he has an ad hoc network with his iPhone he gets an ERROR_INTERNET_TIMEOUT. I presume this is some kind of routing problem. I am curious as to why this gets ERROR_INTE...

How do I transfer a file using wininet that is readable by a php script?

I would like to transfer a text file to a webserver using wininet as if the file was being transferred using a web form that posts the file to the server. Based on answers I've received I've tried the following code: static TCHAR hdrs[] = "Content-Type: multipart/form-data\nContent-Length: 25"; static TCHAR frmdata[] = "file=filename...

Wininet's INTERNET_OPTION_IGNORE_OFFLINE doesn't work?

I'm trying to get Wininet to ignore Internet Explorer's "Work Offline" mode, for both HTTP and FTP. So I'm trying to use InternetSetOption() with INTERNET_OPTION_IGNORE_OFFLINE. The documentation says "This is used by InternetQueryOption and InternetSetOption with a request handle." However, you can't get a request handle because if I...

Windows Mobile WinInet library working with http compresion

On Windows Mobile metod InternetSetOption http://msdn.microsoft.com/en-us/library/ms918381.aspx does not support option INTERNET_OPTION_HTTP_DECODING is there some simple method to turn on compresion under WM 6.0 or any external library that will decompress content received by WinInet ...

What would cause a ERROR_INTERNET_INCORRECT_HANDLE_TYPE (12018) with InternetQueryOption?

I'm working on a simple little function to download a file from an SSL-enabled website using the WinInet functions, namely InternetOpen and InternetOpenURL. I had was initially failing the call to InternetOpenURL with a ERROR_INTERNET_INVALID_CA (12045) because I was using a self-signed certificate on my test server, and found out (htt...

Detect an internet connection activation with Delphi

I've been using a 3G wireless card for a while and every time I connect, my anti-virus fires up the updates. I'm wondering what is the Win32 API set of functions that I can use to, either, get notified or query about the event of an Internet Connection coming up? And is there already a set of ported headers for Delphi? ...

WinInet: timeout management in FTP put

Hi All, My program puts a file into a remote host using HTTP. For some unavoidable reasons, the remote hosts needs some time to acknowledge the final packet of the data transmission. More time than the default timeout, which according to my experience is around 30 seconds. Therefore I wanted to increase the timeout to 5 minutes, usin...

How does wininet handle cookies

I have a .NET client application that needs to communicate with a server using two distinct user credentials. Lets say that the application runs two threads. When start running, every thread sends the user & password to authenticate and the server in return stores a cookie on the http session. The subsequent calls send the authentication...

Is there any good example of http upload using WinInet c++ library

I cannot get my code to work :/ ...

InternetReadFile Problem (error 87 - The parameter is incorrect)

Hello, I have a problem here with InternetReadFile, if I run the application in a computer without proxy, the app runs ok, but if I try to use with a computer using proxy, I receive an error 87 (The parameter is incorrect). Thats my code: conHandle = InternetOpen("Test", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); ... hFile = Inte...

WinINet: How to prevent HttpSendRequest to follow redirects (30x Status Codes)?

When I make an HTTP request with the method HttpSendRequest of the WinINet API, and the response sends "302: Moved Temporarily", the WinINet API automatically follows the redirection instruction and makes a new request. So, How to prevent HttpSendRequest to follow redirects (30x Status Codes)? I don't want't to make two requests... I w...

InternetCheckConnection always return false

I want to use the wininet function InternetCheckConnection to check whenever the machine is connected to the internet and can access a specific host. The problem is that this function is always returning false, no matter the URL I put on it. MSDN link ...

Calling a webmethod from C++

Hi guys I am calling a webmethod from C++. The [webmthod] is defined as follows [WebMethod] public string UploadFile(byte[] data) Here is how I call it in C++ static TCHAR hdrs[] = "Content-Type: application/x-www-form-urlencoded"; static TCHAR frmdata[] = "data=temp.txt"; HINTERNET hSession = InternetOpen("MyAgent",INTE...

Manually validate server certificate in WinINet

I'm trying to implement manual self-signed SSL certificate validation to a WinINet client. I tried to approach it by calling InternetQueryOption with INTERNET_OPTION_SECURITY_CERTIFICATE or INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT parameters, but both return some internal interpretation of server's certificate, none allows accessing ...

Regarding Latency In Ping

What is meant by latency which is returned by ping ...

Bandwidth from Latency

DUPE: http://stackoverflow.com/questions/729146/how-to-programmatically-check-internet-bandwidth-in-vc Can we find the bandwidth from the latency of ping .If yes how is it done ...

How to clear MSIE/WinInet cache programatically?

I'm trying to clear out the WinInet cache using Win32 API - by invalidating the cache entries, or deleting them (doesn't matter). I can't find any way to do this for the whole cache (other than iterating over each entry - example in C#, another in VB) - is this even possible? ...

C++ WinInet Wrapper for Windows Mobile

Environment: Win32, C++/VS2008 I'm getting into the need to make HTTP (not HTTPS) requests from the internet using a Windows Mobile phone and to save time + reinventing the wheel, wondered if anybody here might have kindly shared a simple C++ (Win32?) WinInet wrapper or similar class? The closest I found so far using Google is on code...

InternetAttemptConnect() fails with

My application uses the WinInet api. Using the MFC wrapper classes (CHttpConnection, CHttpFile, etc), I am able to connect, send requests, and receive responses without a hitch. Another part of the application (older code) uses InternetAttemptConnect() and InternetOpen(). InternetAttemptConnect() fails with ERROR_GEN_FAILURE, whose descr...