Discussion:
FTP via HTTP
(too old to reply)
Brian Combs
2004-09-14 14:52:34 UTC
Permalink
Hello
Please see the following article: 166961 How To FTP with CERN-Based Proxy
Using WinInet API
http://support.microsoft.com/?id=166961

Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: FTP via HTTP
| thread-index: AcSZtGAVg9Kjuw5YSpSrPtWJf4hnZQ==
| X-WBNR-Posting-Host: 194.36.128.105
| From: =?Utf-8?B?QVNtYWxs?= <***@discussions.microsoft.com>
| Subject: FTP via HTTP
| Date: Mon, 13 Sep 2004 10:09:05 -0700
| Lines: 10
| Message-ID: <A132029E-C645-4E44-B570-***@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl
microsoft.public.inetsdk.programming.wininet:11682
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| In InternetOpen() there's a sentence: "FTP requests can be made through a
| CERN type proxy either by changing them to an HTTP request...". How is
this
| done?
|
| I'm trying to route an FTP download via a proxy that doesn't support FTP.
| IE/Firefox can connect as an anonymous user and display the file, but my
app
| throws a 30 second time out CInternetException when calling
| CInternetSession::GetFtpConnection().
|
| System requirements are that the OS is 2000 or XP. Minimum IE 5.5
installed.
|
ASmall
2004-09-20 15:25:04 UTC
Permalink
Still having problems... here's my code:
CString strProxy,strURL(_T("ftp://1.2.3.4/pub/myfile.bin"));
strProxy.Format(_T("ftp=ftp://%s:%s"), m_strAddress, m_strPort );
CInternetSession* pIS = new
CInternetSession(NULL,1,INTERNET_OPEN_TYPE_PROXY,strProxy);
CHttpFile* pIF = reinterpret_cast<CHttpFile*>(pIS->OpenURL( strURL, 1,
INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_EXISTING_CONNECT ));
if(pIF){ // Never get here as OpenURL throws "The FTP session was terminated
"...

Where do I respond to entering a username/password for the proxy? After
looking at Q195650, I was expecting pIF to be valid (not exactly proud of the
casting) and then call:
pIF->SendRequest();
pIF->QueryInfoStatusCode(dwRet);
if (HTTP_STATUS_PROXY_AUTH_REQ==dwRet){
pIF->SetOption(...)
}
// Do file read here.

Thank you,
Post by Brian Combs
Hello
Please see the following article: 166961 How To FTP with CERN-Based Proxy
Using WinInet API
http://support.microsoft.com/?id=166961
Thanks
Brian [MSFT]
Microsoft Developer Support
Brian Combs
2004-09-24 20:05:30 UTC
Permalink
Hello
InternetOpenUrl does not provide any way to handle authentication.
Please see the following article: 172712 INFO: Limitations of WinInet FTP
Functions
http://support.microsoft.com/?id=172712

Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: FTP via HTTP
| thread-index: AcSfJgDgpoQQ+bEoToSR7jta9BpOTA==
| X-WBNR-Posting-Host: 194.36.128.105
| From: =?Utf-8?B?QVNtYWxs?= <***@discussions.microsoft.com>
| References: <A132029E-C645-4E44-B570-***@microsoft.com>
<***@cpmsftngxa06.phx.gbl>
| Subject: RE: FTP via HTTP
| Date: Mon, 20 Sep 2004 08:25:04 -0700
| Lines: 33
| Message-ID: <0AF80086-A453-452F-A22C-***@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11351
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Still having problems... here's my code:
| CString strProxy,strURL(_T("ftp://1.2.3.4/pub/myfile.bin"));
| strProxy.Format(_T("ftp=ftp://%s:%s"), m_strAddress, m_strPort );
| CInternetSession* pIS = new
| CInternetSession(NULL,1,INTERNET_OPEN_TYPE_PROXY,strProxy);
| CHttpFile* pIF = reinterpret_cast<CHttpFile*>(pIS->OpenURL( strURL, 1,
| INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_EXISTING_CONNECT ));
| if(pIF){ // Never get here as OpenURL throws "The FTP session was
terminated
| "...
|
| Where do I respond to entering a username/password for the proxy? After
| looking at Q195650, I was expecting pIF to be valid (not exactly proud of
the
| casting) and then call:
| pIF->SendRequest();
| pIF->QueryInfoStatusCode(dwRet);
| if (HTTP_STATUS_PROXY_AUTH_REQ==dwRet){
| pIF->SetOption(...)
| }
| // Do file read here.
|
| Thank you,
|
| "Brian Combs" wrote:
|
| > Hello
| > Please see the following article: 166961 How To FTP with CERN-Based
Proxy
| > Using WinInet API
| > http://support.microsoft.com/?id=166961
| >
| > Thanks
| > Brian [MSFT]
| > Microsoft Developer Support
|
|
Brian Combs
2004-09-24 20:24:18 UTC
Permalink
Also see 216214 SAMPLE: FTP with CERN-Based Password Protected Proxy Using
WinInet
http://support.microsoft.com/?id=216214

Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: FTP via HTTP
| thread-index: AcSfJgDgpoQQ+bEoToSR7jta9BpOTA==
| X-WBNR-Posting-Host: 194.36.128.105
| From: =?Utf-8?B?QVNtYWxs?= <***@discussions.microsoft.com>
| References: <A132029E-C645-4E44-B570-***@microsoft.com>
<***@cpmsftngxa06.phx.gbl>
| Subject: RE: FTP via HTTP
| Date: Mon, 20 Sep 2004 08:25:04 -0700
| Lines: 33
| Message-ID: <0AF80086-A453-452F-A22C-***@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11351
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Still having problems... here's my code:
| CString strProxy,strURL(_T("ftp://1.2.3.4/pub/myfile.bin"));
| strProxy.Format(_T("ftp=ftp://%s:%s"), m_strAddress, m_strPort );
| CInternetSession* pIS = new
| CInternetSession(NULL,1,INTERNET_OPEN_TYPE_PROXY,strProxy);
| CHttpFile* pIF = reinterpret_cast<CHttpFile*>(pIS->OpenURL( strURL, 1,
| INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_EXISTING_CONNECT ));
| if(pIF){ // Never get here as OpenURL throws "The FTP session was
terminated
| "...
|
| Where do I respond to entering a username/password for the proxy? After
| looking at Q195650, I was expecting pIF to be valid (not exactly proud of
the
| casting) and then call:
| pIF->SendRequest();
| pIF->QueryInfoStatusCode(dwRet);
| if (HTTP_STATUS_PROXY_AUTH_REQ==dwRet){
| pIF->SetOption(...)
| }
| // Do file read here.
|
| Thank you,
|
| "Brian Combs" wrote:
|
| > Hello
| > Please see the following article: 166961 How To FTP with CERN-Based
Proxy
| > Using WinInet API
| > http://support.microsoft.com/?id=166961
| >
| > Thanks
| > Brian [MSFT]
| > Microsoft Developer Support
|
|

Loading...