The code follows:
hInternet=InternetOpen("MyWebBrowser", INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0);
hConnect=InternetConnect(hInternet,"ftp.someFtpSite.it",
INTERNET_INVALID_PORT_NUMBER, "userName",
"password",INTERNET_SERVICE_FTP,0,0);
I also tried to give the two functions other parameters, not using
Wininet proxy autodetection:
hInternet=InternetOpen("MyWebBrowser",INTERNET_OPEN_TYPE_PROXY,"sistedit:80",NULL,0);
hConnect=InternetConnect(hInternet,"ftp.SomeFtpSite.it",INTERNET_DEFAULT_FTP_PORT,"userName","password",INTERNET_SERVICE_FTP,0,0);
I also use the suggested syntax for the proxy server name, like this:
ftp=ftp://sistedit:80.
Any suggestions?
Ruggero Rossi
Is your proxy set up to allow FTP connections? From your code, it looks
like you are using an HTTP proxy, which will only intercept HTTP
connections, and not FTP connections (I base this on the fact that your
proxy is running on port 80).
--
- Nicholas Paldino
- nicholas...@exisconsulting.com
- casp...@caspershouse.com
As far as I know, wininet FTP functions do not work properly behind
a proxy connection. I discovered a way to handle FTP requests behind a
proxy, but I was using MFC CInternetSession, CHttpConnection classes,
which are simply a wrapper over the wininet functions. But the idea is
to make a dummy HTTP request to the internet behind a proxy before
making a FTP request.
1. Make a CInternetSession (ie. InternetConnect() in wininet)
2. Make a CHttpConnection and CHttpFile (ie HttpOpenRequest() in
wininet)
3. Now do a CHttpFile::SendRequest (ie HttpSendRequest() in wininet)
4. Get the status code using CHttpFile::QueryInfoStatusCode (ie
HttpQueryInfo() in wininet)
5. Handle all the proxy username and password requests.
6. Now do a CInternetSession::OpenUrl() (ie. InternetOpenUrl() in
wininet).
7. Alse specify the passive tag in the InternetOpenUrl function.
This should get u there.
tdh_13
(Tom_Dickn_Harry)
In article <385E4E48...@libero.it>,
Sent via Deja.com http://www.deja.com/
Before you buy.
Look on www.codeguru.com for some examples
Brad
tdh...@my-deja.com wrote in message <83s7e3$on9$1...@nnrp1.deja.com>...