How to get a https file
-
Hi Can anybody help me? I have a https-file on a server in the internet and want to get the file. The adress look like: https://ss004.ak.se/http://ss005.ak...productLogo.gif This is not the right adress is only a example. I managed to get a CInternetSession pointer and with that I made a GetHttpConnection to get a pointer to CHttpConnection. With that pointer I know I need to make a OpenRequest() but from that point on I have no clue what to write next. What do I have to do for that??? Thanks D
-
Hi Can anybody help me? I have a https-file on a server in the internet and want to get the file. The adress look like: https://ss004.ak.se/http://ss005.ak...productLogo.gif This is not the right adress is only a example. I managed to get a CInternetSession pointer and with that I made a GetHttpConnection to get a pointer to CHttpConnection. With that pointer I know I need to make a OpenRequest() but from that point on I have no clue what to write next. What do I have to do for that??? Thanks D
Hi , i have also done the same thing once but using Wininet APIS i can guide u how to use them. To use the HTTP WinInet functions Call the InternetOpen function to initialize an Internet handle. InternetOpen creates the root HINTERNET handle used to establish the HTTP session. The HINTERNET is used by all subsequent functions. Call InternetConnect using the HINTERNET returned by InternetOpen to create an HTTP session. When calling InternetConnect, specify INTERNET_DEFAULT_HTTP for the nServerPort parameter and INTERNET_SERVICE_HTTP for the dwService parameter. InternetConnect uses the handle returned by InternetOpen to create a specific HTTP session. InternetConnect initializes an HTTP session for the specified site, using the arguments passed to it and creates HINTERNET that is a branch off the root handle. InternetConnect does not attempt to access or establish a connection to the specified site. Call HttpOpenRequest to open an HTTP request handle. HttpOpenRequest uses the handle created by InternetConnect to establish a connection to the specified site. Call HttpSendRequest using the handle created by the HttpOpenRequest to send an HTTP request to the HTTP server. Call InternetReadFile to download data. –Or– Call InternetQueryDataAvailable to query how much data is available to be read by a subsequent call to InternetReadFile. Call InternetCloseHandle to close the handle created by HttpOpenRequest. Call InternetCloseHandle to close the HTTP session created by InternetConnect. Call InternetCloseHandle to close the handle created by InternetOpen. in this way u can download ur file :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)
-
Hi Can anybody help me? I have a https-file on a server in the internet and want to get the file. The adress look like: https://ss004.ak.se/http://ss005.ak...productLogo.gif This is not the right adress is only a example. I managed to get a CInternetSession pointer and with that I made a GetHttpConnection to get a pointer to CHttpConnection. With that pointer I know I need to make a OpenRequest() but from that point on I have no clue what to write next. What do I have to do for that??? Thanks D
You could maybe use
URLDownloadToCacheFile
. The word of the day is legs, let's go back to my house and spread the word ;P -
Hi , i have also done the same thing once but using Wininet APIS i can guide u how to use them. To use the HTTP WinInet functions Call the InternetOpen function to initialize an Internet handle. InternetOpen creates the root HINTERNET handle used to establish the HTTP session. The HINTERNET is used by all subsequent functions. Call InternetConnect using the HINTERNET returned by InternetOpen to create an HTTP session. When calling InternetConnect, specify INTERNET_DEFAULT_HTTP for the nServerPort parameter and INTERNET_SERVICE_HTTP for the dwService parameter. InternetConnect uses the handle returned by InternetOpen to create a specific HTTP session. InternetConnect initializes an HTTP session for the specified site, using the arguments passed to it and creates HINTERNET that is a branch off the root handle. InternetConnect does not attempt to access or establish a connection to the specified site. Call HttpOpenRequest to open an HTTP request handle. HttpOpenRequest uses the handle created by InternetConnect to establish a connection to the specified site. Call HttpSendRequest using the handle created by the HttpOpenRequest to send an HTTP request to the HTTP server. Call InternetReadFile to download data. –Or– Call InternetQueryDataAvailable to query how much data is available to be read by a subsequent call to InternetReadFile. Call InternetCloseHandle to close the handle created by HttpOpenRequest. Call InternetCloseHandle to close the HTTP session created by InternetConnect. Call InternetCloseHandle to close the handle created by InternetOpen. in this way u can download ur file :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)
I did that too but it works only with http files if I am not wrong. It doesn't work with https web pages ! The problem is how to handle the SSL. How can that be done in C++ ? Especially if it is a page that need a login Thank you very much for any answer ! Marcello