Discussion:
Controlling FtpGetFile
(too old to reply)
Graham Allwood
2004-08-08 08:02:35 UTC
Permalink
Hi,

Is there any way in stopping FTPGetFile from issuing a SIZE command on the
remote server? I have come across an FTP site that does not understand the
SIZE command and as a result I cannot download any files from it.
FTPCommand(...,'RETR',...), FTPGetFile and FTPOpenFile all issue a SIZE
command before RETR. How can I stop this?

If its not possible to stop does anyone know of a different way of
downloading from an FTP site?

Thanks for your help
Graham
Brian Combs
2004-08-09 21:54:29 UTC
Permalink
Hello
This behavior is by design and there is no way you can change it. You may
want to look at 3rd party FTP libs.


Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Graham Allwood" <***@nospamtoEborsolutions.com>
| Subject: Controlling FtpGetFile
| Date: Sun, 8 Aug 2004 09:02:35 +0100
| Lines: 15
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Message-ID: <#***@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11237
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Hi,
|
| Is there any way in stopping FTPGetFile from issuing a SIZE command on the
| remote server? I have come across an FTP site that does not understand the
| SIZE command and as a result I cannot download any files from it.
| FTPCommand(...,'RETR',...), FTPGetFile and FTPOpenFile all issue a SIZE
| command before RETR. How can I stop this?
|
| If its not possible to stop does anyone know of a different way of
| downloading from an FTP site?
|
| Thanks for your help
| Graham
|
|
|
Paul Baker [MVP, Windows - SDK]
2004-08-10 16:10:49 UTC
Permalink
Graham,

What does the FTP server in question do with the SIZE command? Does it
return 0 or does it return an error?

Brian,

Are you sure?

Can't you just call FtpOpenFile and InternetReadFile until it is done, ie.
the connection is closed? If it does send a SIZE command, what does it use
it for? I didn't think that had anything to do with when InternetReadFile is
done.

If you call FtpFindFirstFile, I believe it sends a LIST command and parses
the results (if it can, which is only guaranteed to work with DOS, Windows
and UNIX servers).

You can call FtpGetFileSize in IE5. I don't know if that sends a LIST
command or SIZE command.

I was not aware that any other WinInet function ever sent a SIZE command.

Maybe I can look at the source code through the MVPSLP.

Paul
Post by Brian Combs
Hello
This behavior is by design and there is no way you can change it. You may
want to look at 3rd party FTP libs.
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Subject: Controlling FtpGetFile
| Date: Sun, 8 Aug 2004 09:02:35 +0100
| Lines: 15
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
Post by Brian Combs
phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11237
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Hi,
|
| Is there any way in stopping FTPGetFile from issuing a SIZE command on the
| remote server? I have come across an FTP site that does not understand the
| SIZE command and as a result I cannot download any files from it.
| FTPCommand(...,'RETR',...), FTPGetFile and FTPOpenFile all issue a SIZE
| command before RETR. How can I stop this?
|
| If its not possible to stop does anyone know of a different way of
| downloading from an FTP site?
|
| Thanks for your help
| Graham
|
|
|
Paul Baker [MVP, Windows - SDK]
2004-08-10 23:38:15 UTC
Permalink
"Paul Baker [MVP, Windows - SDK]" <***@online.rochester.rr.com> wrote in
message news:***@TK2MSFTNGP09.phx.gbl...
[snip]
Post by Paul Baker [MVP, Windows - SDK]
Maybe I can look at the source code through the MVPSLP.
Source code for WinInet is apparently not currently available.

Paul
Gravy
2004-08-11 10:37:24 UTC
Permalink
Paul, thanks for your response.

both FtpGetfile and FTPOpenFile issue a SIZE command before the RETR.

The ftp server returns an error when is comes accross SIZE, uncognised
command!

It's looking like I shall have to search out a replacement lib for ftp. Does
anyone know of one - one that's free of course ;-)

Graham
Post by Paul Baker [MVP, Windows - SDK]
[snip]
Post by Paul Baker [MVP, Windows - SDK]
Maybe I can look at the source code through the MVPSLP.
Source code for WinInet is apparently not currently available.
Paul
Paul Baker [MVP, Windows - SDK]
2004-08-11 13:23:47 UTC
Permalink
Graham,

As I said, I am able to use FtpOpenFile to download a file from an FTP
server that does not support the SIZE command (responds with an error like
you describe), so your premise that WinInet cannot be used to download a
file from an FTP server that does not support the SIZE command is false.
There is something more going on here.

I am not sure why Brian from Microsoft would try to steer you away from his
company's own product, because it works for me and perhaps we just need some
troubleshooting. I feel like a Microsoft sales rep!

Paul
Post by Gravy
Paul, thanks for your response.
both FtpGetfile and FTPOpenFile issue a SIZE command before the RETR.
The ftp server returns an error when is comes accross SIZE, uncognised
command!
It's looking like I shall have to search out a replacement lib for ftp. Does
anyone know of one - one that's free of course ;-)
Graham
Post by Paul Baker [MVP, Windows - SDK]
[snip]
Post by Paul Baker [MVP, Windows - SDK]
Maybe I can look at the source code through the MVPSLP.
Source code for WinInet is apparently not currently available.
Paul
Brian Combs
2004-08-12 17:17:19 UTC
Permalink
Hello
This we do know, WinInet will send the Size command for any of the
following commands: FtpOpenFile, FtpGetFile, and FtpCommand with RETR as
the command.
So I will assume that it depends on how the FTP server response to a
command that it does not understand that could cause WinInet to fail. You
can get network trace and WinInet log to see what is going on. Also we know
that WinInet is limited for FTP.

172712 INFO: Limitations of WinInet FTP Functions
http://support.microsoft.com/?id=172712

You can download debug builds of WinInet.Dll from the following location:
ftp://ftp.microsoft.com/PSS/Tools/Developer%20Support%20Tools/WinInet/
You should use the build number that is closest to the version of WinInet
that is on your system.

On Win ME/ Windows 2000/ Windows XP and greater OSs with Windows File
Protection

1. Configure Internet Explorer to use a default Start Page as close to the
page as possible. This eliminates much unnecessary logging that will add
additional size to the output log.
2. Close Internet Explorer as well as any other Internet-based applications
(additional applications that use WININET for connectivity may generate
extra traffic within the log).
3. Navigate to the location of where Internet Explorer is installed.
Typically this is either the \Program Files\Internet Explorer folder or the
\Program Files\Plus!\Microsoft Internet folder.
4. You must have extensions viewable so that the proper extension is
assigned to your file. You can turn on the extensions for all files by
going into the Folder Options from within Windows Explorer and choosing the
View tab and selecting to ‘Show all files’ and to not “Hide extensions of
known file types”.
5. Create a dummy file out of a new text file. Rename the file to the
following filename and extension:

IEXPLORE.EXE.LOCAL

The proper extension for this file is .local If you create this file and
you still have a Notepad icon for the file, re-do step 4 above.
6. Once the file has been created successfully, copy a suitable logging
version of WININET.DLL into the same directory as the file you created in
step 5.
7. Once the logging version of WININET is in place, open a CMD prompt.
Navigate to the location of where Internet Explorer is installed.
Typically this is either the \Program Files\Internet Explorer folder or the
\Program Files\Plus!\Microsoft Internet folder.
8. At the CMD prompt, type the following and hit <enter>:

SET WININETLOG=1

9. Now that the logging environment variable is set, you can now start the
logging by typing the following and hitting <enter>:

IEXPLORE.EXE

10. Internet Explorer should now open on the desktop and navigate to the
Start Page. It is important that you do not close either the CMD window or
Internet Explorer. As soon as Internet Explorer starts navigation, a
WININET.LOG file will be created on the desktop. Do not attempt to open
this log while it is being written to.
11. Recreate the problem. Once the behavior is observed, you can now
safely close Internet Explorer, as well as the CMD window. Logging should
cease. The log file should be zipped up and forwarded to a support
professional that has been trained to read these logs. If the log is too
large to send via Microsoft email (5mb), then it must be placed on the
FTPPSS FTP site (ftp://ftppss.microsoft.com)
12. Very Important: once logging is complete, you should remove the
logging version of WININET.DLL and the IEXPLORE.EXE.LOCAL file. Leaving
the logging version of WININET.DLL in place can affect overall browsing
performance because of the numerous checks written into that version.

TIP: For contrast purposes, it would be advisable to have a log of the
problem occurring and one of a normal condition, if possible. Also, a
Network Monitor packet trace that is taken at the same time as the WININET
log may also be beneficial when attempting to correlate network patterns
during the WININET communication.

NOTE: All of Microsoft’s operating systems from Windows 2000 and forward
support the use of IEXPLORE.EXE.LOCAL. This concept is called Dynamic Link
Library Redirection and documented online at http://msdn.microsoft.com.

NOTE: If you are using a custome WinInet application you can replace
IEXPLORE.EXE.LOCAL with your Application file name. And then run your
application from the command prompt.

NOTE: You can change where the log file is saved by setting environment
variable WininetLogFile, like this:
"set wininetlogfile=c:\temp\MyNewLog.log" with out the quotes.


Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Paul Baker [MVP, Windows - SDK]" <***@online.rochester.rr.com>
| References: <#***@TK2MSFTNGP09.phx.gbl>
<***@cpmsftngxa06.phx.gbl>
<***@TK2MSFTNGP09.phx.gbl>
<***@TK2MSFTNGP11.phx.gbl>
<***@TK2MSFTNGP09.phx.gbl>
| Subject: Re: Controlling FtpGetFile
| Date: Wed, 11 Aug 2004 09:23:47 -0400
| Lines: 47
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| Message-ID: <***@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 66-192-38-14.bccsoftware.com 66.192.38.14
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11247
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Graham,
|
| As I said, I am able to use FtpOpenFile to download a file from an FTP
| server that does not support the SIZE command (responds with an error like
| you describe), so your premise that WinInet cannot be used to download a
| file from an FTP server that does not support the SIZE command is false.
| There is something more going on here.
|
| I am not sure why Brian from Microsoft would try to steer you away from
his
| company's own product, because it works for me and perhaps we just need
some
| troubleshooting. I feel like a Microsoft sales rep!
|
| Paul
|
| "Gravy" <***@discussions.microsoft.com> wrote in message
| news:***@TK2MSFTNGP09.phx.gbl...
| > Paul, thanks for your response.
| >
| > both FtpGetfile and FTPOpenFile issue a SIZE command before the RETR.
| >
| > The ftp server returns an error when is comes accross SIZE, uncognised
| > command!
| >
| > It's looking like I shall have to search out a replacement lib for ftp.
| Does
| > anyone know of one - one that's free of course ;-)
| >
| > Graham
| >
| > "Paul Baker [MVP, Windows - SDK]" <***@online.rochester.rr.com> wrote
in
| > message news:***@TK2MSFTNGP11.phx.gbl...
| > > "Paul Baker [MVP, Windows - SDK]" <***@online.rochester.rr.com>
wrote
| in
| > > message news:***@TK2MSFTNGP09.phx.gbl...
| > > [snip]
| > > > Maybe I can look at the source code through the MVPSLP.
| > >
| > >
| > > Source code for WinInet is apparently not currently available.
| > >
| > > Paul
| > >
| > >
| >
| >
|
|
|
Gravy
2004-08-16 14:40:22 UTC
Permalink
Thanks for the response you guys.

Brian, near the bottom of your last email you had instructions on how to
start wininet logging, there is one part of this I have a slight problem
with:

...
NOTE: If you are using a custome WinInet application you can replace
IEXPLORE.EXE.LOCAL with your Application file name. And then run your
application from the command prompt.
...

My application that uses WinINet is a C++ service, I hope this doesn't
complicate matters too much.

Anyway, once I have followed the logging steps I run the service and also
DebugView (from SysInternals.com) and I get the following message in my
Debug window:

Wininet Assertion Failed: 0
Source file: g:\n2\inetcore\wininet\urlcache\filemap.cxx
Source line: 1146
Thread: 00000be8

and my server then does nothing else, appart from retry eveny 1 minute or
so.

I'm running XP SP2 with the debug Wininet dll vernion 6.0.2800.1106. have
you any ideas what wrong??

Thanks for your help

Graham
Post by Brian Combs
Hello
This we do know, WinInet will send the Size command for any of the
following commands: FtpOpenFile, FtpGetFile, and FtpCommand with RETR as
the command.
So I will assume that it depends on how the FTP server response to a
command that it does not understand that could cause WinInet to fail. You
can get network trace and WinInet log to see what is going on. Also we know
that WinInet is limited for FTP.
172712 INFO: Limitations of WinInet FTP Functions
http://support.microsoft.com/?id=172712
ftp://ftp.microsoft.com/PSS/Tools/Developer%20Support%20Tools/WinInet/
You should use the build number that is closest to the version of WinInet
that is on your system.
On Win ME/ Windows 2000/ Windows XP and greater OSs with Windows File
Protection
1. Configure Internet Explorer to use a default Start Page as close to the
page as possible. This eliminates much unnecessary logging that will add
additional size to the output log.
2. Close Internet Explorer as well as any other Internet-based
applications
(additional applications that use WININET for connectivity may generate
extra traffic within the log).
3. Navigate to the location of where Internet Explorer is installed.
Typically this is either the \Program Files\Internet Explorer folder or the
\Program Files\Plus!\Microsoft Internet folder.
4. You must have extensions viewable so that the proper extension is
assigned to your file. You can turn on the extensions for all files by
going into the Folder Options from within Windows Explorer and choosing the
View tab and selecting to 'Show all files' and to not "Hide extensions of
known file types".
5. Create a dummy file out of a new text file. Rename the file to the
IEXPLORE.EXE.LOCAL
The proper extension for this file is .local If you create this file and
you still have a Notepad icon for the file, re-do step 4 above.
6. Once the file has been created successfully, copy a suitable logging
version of WININET.DLL into the same directory as the file you created in
step 5.
7. Once the logging version of WININET is in place, open a CMD prompt.
Navigate to the location of where Internet Explorer is installed.
Typically this is either the \Program Files\Internet Explorer folder or the
\Program Files\Plus!\Microsoft Internet folder.
SET WININETLOG=1
9. Now that the logging environment variable is set, you can now start the
IEXPLORE.EXE
10. Internet Explorer should now open on the desktop and navigate to the
Start Page. It is important that you do not close either the CMD window or
Internet Explorer. As soon as Internet Explorer starts navigation, a
WININET.LOG file will be created on the desktop. Do not attempt to open
this log while it is being written to.
11. Recreate the problem. Once the behavior is observed, you can now
safely close Internet Explorer, as well as the CMD window. Logging should
cease. The log file should be zipped up and forwarded to a support
professional that has been trained to read these logs. If the log is too
large to send via Microsoft email (5mb), then it must be placed on the
FTPPSS FTP site (ftp://ftppss.microsoft.com)
12. Very Important: once logging is complete, you should remove the
logging version of WININET.DLL and the IEXPLORE.EXE.LOCAL file. Leaving
the logging version of WININET.DLL in place can affect overall browsing
performance because of the numerous checks written into that version.
TIP: For contrast purposes, it would be advisable to have a log of the
problem occurring and one of a normal condition, if possible. Also, a
Network Monitor packet trace that is taken at the same time as the WININET
log may also be beneficial when attempting to correlate network patterns
during the WININET communication.
NOTE: All of Microsoft's operating systems from Windows 2000 and forward
support the use of IEXPLORE.EXE.LOCAL. This concept is called Dynamic Link
Library Redirection and documented online at http://msdn.microsoft.com.
NOTE: If you are using a custome WinInet application you can replace
IEXPLORE.EXE.LOCAL with your Application file name. And then run your
application from the command prompt.
NOTE: You can change where the log file is saved by setting environment
"set wininetlogfile=c:\temp\MyNewLog.log" with out the quotes.
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Subject: Re: Controlling FtpGetFile
| Date: Wed, 11 Aug 2004 09:23:47 -0400
| Lines: 47
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 66-192-38-14.bccsoftware.com 66.192.38.14
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11247
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Graham,
|
| As I said, I am able to use FtpOpenFile to download a file from an FTP
| server that does not support the SIZE command (responds with an error like
| you describe), so your premise that WinInet cannot be used to download a
| file from an FTP server that does not support the SIZE command is false.
| There is something more going on here.
|
| I am not sure why Brian from Microsoft would try to steer you away from
his
| company's own product, because it works for me and perhaps we just need
some
| troubleshooting. I feel like a Microsoft sales rep!
|
| Paul
|
| > Paul, thanks for your response.
| >
| > both FtpGetfile and FTPOpenFile issue a SIZE command before the RETR.
| >
| > The ftp server returns an error when is comes accross SIZE, uncognised
| > command!
| >
| > It's looking like I shall have to search out a replacement lib for ftp.
| Does
| > anyone know of one - one that's free of course ;-)
| >
| > Graham
| >
in
| in
| > > [snip]
| > > > Maybe I can look at the source code through the MVPSLP.
| > >
| > >
| > > Source code for WinInet is apparently not currently available.
| > >
| > > Paul
| > >
| > >
| >
| >
|
|
|
Brian Combs
2004-08-20 20:40:22 UTC
Permalink
Hello
WinInet is not supported for use in a service.
238425 INFO: WinInet Not Supported for Use in Services
http://support.microsoft.com/?id=238425

Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Gravy" <***@discussions.microsoft.com>
| References: <#***@TK2MSFTNGP09.phx.gbl>
<***@cpmsftngxa06.phx.gbl>
<***@TK2MSFTNGP09.phx.gbl>
<***@TK2MSFTNGP11.phx.gbl>
<***@TK2MSFTNGP09.phx.gbl>
<***@tk2msftngp13.phx.gbl>
<***@cpmsftngxa06.phx.gbl>
| Subject: Re: Controlling FtpGetFile
| Date: Mon, 16 Aug 2004 15:40:22 +0100
| Lines: 221
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <***@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11257
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Thanks for the response you guys.
|
| Brian, near the bottom of your last email you had instructions on how to
| start wininet logging, there is one part of this I have a slight problem
| with:
|
| ...
| NOTE: If you are using a custome WinInet application you can replace
| IEXPLORE.EXE.LOCAL with your Application file name. And then run your
| application from the command prompt.
| ...
|
| My application that uses WinINet is a C++ service, I hope this doesn't
| complicate matters too much.
|
| Anyway, once I have followed the logging steps I run the service and also
| DebugView (from SysInternals.com) and I get the following message in my
| Debug window:
|
| Wininet Assertion Failed: 0
| Source file: g:\n2\inetcore\wininet\urlcache\filemap.cxx
| Source line: 1146
| Thread: 00000be8
|
| and my server then does nothing else, appart from retry eveny 1 minute or
| so.
|
| I'm running XP SP2 with the debug Wininet dll vernion 6.0.2800.1106. have
| you any ideas what wrong??
|
| Thanks for your help
|
| Graham
| "Brian Combs" <***@online.microsoft.com> wrote in message
| news:***@cpmsftngxa06.phx.gbl...
| > Hello
| > This we do know, WinInet will send the Size command for any of the
| > following commands: FtpOpenFile, FtpGetFile, and FtpCommand with RETR as
| > the command.
| > So I will assume that it depends on how the FTP server response to a
| > command that it does not understand that could cause WinInet to fail.
You
| > can get network trace and WinInet log to see what is going on. Also we
| > know
| > that WinInet is limited for FTP.
| >
| > 172712 INFO: Limitations of WinInet FTP Functions
| > http://support.microsoft.com/?id=172712
| >
| > You can download debug builds of WinInet.Dll from the following
location:
| > ftp://ftp.microsoft.com/PSS/Tools/Developer%20Support%20Tools/WinInet/
| > You should use the build number that is closest to the version of
WinInet
| > that is on your system.
| >
| > On Win ME/ Windows 2000/ Windows XP and greater OSs with Windows File
| > Protection
| >
| > 1. Configure Internet Explorer to use a default Start Page as close to
the
| > page as possible. This eliminates much unnecessary logging that will
add
| > additional size to the output log.
| > 2. Close Internet Explorer as well as any other Internet-based
| > applications
| > (additional applications that use WININET for connectivity may generate
| > extra traffic within the log).
| > 3. Navigate to the location of where Internet Explorer is installed.
| > Typically this is either the \Program Files\Internet Explorer folder or
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| > 4. You must have extensions viewable so that the proper extension is
| > assigned to your file. You can turn on the extensions for all files by
| > going into the Folder Options from within Windows Explorer and choosing
| > the
| > View tab and selecting to 'Show all files' and to not "Hide extensions
of
| > known file types".
| > 5. Create a dummy file out of a new text file. Rename the file to the
| > following filename and extension:
| >
| > IEXPLORE.EXE.LOCAL
| >
| > The proper extension for this file is .local If you create this file
and
| > you still have a Notepad icon for the file, re-do step 4 above.
| > 6. Once the file has been created successfully, copy a suitable logging
| > version of WININET.DLL into the same directory as the file you created
in
| > step 5.
| > 7. Once the logging version of WININET is in place, open a CMD prompt.
| > Navigate to the location of where Internet Explorer is installed.
| > Typically this is either the \Program Files\Internet Explorer folder or
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| > 8. At the CMD prompt, type the following and hit <enter>:
| >
| > SET WININETLOG=1
| >
| > 9. Now that the logging environment variable is set, you can now start
the
| > logging by typing the following and hitting <enter>:
| >
| > IEXPLORE.EXE
| >
| > 10. Internet Explorer should now open on the desktop and navigate to the
| > Start Page. It is important that you do not close either the CMD
window
| > or
| > Internet Explorer. As soon as Internet Explorer starts navigation, a
| > WININET.LOG file will be created on the desktop. Do not attempt to open
| > this log while it is being written to.
| > 11. Recreate the problem. Once the behavior is observed, you can now
| > safely close Internet Explorer, as well as the CMD window. Logging
should
| > cease. The log file should be zipped up and forwarded to a support
| > professional that has been trained to read these logs. If the log is
too
| > large to send via Microsoft email (5mb), then it must be placed on the
| > FTPPSS FTP site (ftp://ftppss.microsoft.com)
| > 12. Very Important: once logging is complete, you should remove the
| > logging version of WININET.DLL and the IEXPLORE.EXE.LOCAL file. Leaving
| > the logging version of WININET.DLL in place can affect overall browsing
| > performance because of the numerous checks written into that version.
| >
| > TIP: For contrast purposes, it would be advisable to have a log of
the
| > problem occurring and one of a normal condition, if possible. Also, a
| > Network Monitor packet trace that is taken at the same time as the
WININET
| > log may also be beneficial when attempting to correlate network patterns
| > during the WININET communication.
| >
| > NOTE: All of Microsoft's operating systems from Windows 2000 and
forward
| > support the use of IEXPLORE.EXE.LOCAL. This concept is called Dynamic
| > Link
| > Library Redirection and documented online at http://msdn.microsoft.com.
| >
| > NOTE: If you are using a custome WinInet application you can replace
| > IEXPLORE.EXE.LOCAL with your Application file name. And then run your
| > application from the command prompt.
| >
| > NOTE: You can change where the log file is saved by setting environment
| > variable WininetLogFile, like this:
| > "set wininetlogfile=c:\temp\MyNewLog.log" with out the quotes.
| >
| >
| > Thanks
| > Brian [MSFT]
| > Microsoft Developer Support
| > This posting is provided "AS IS" with no warranties, and confers no
| > rights.
| > --------------------
| > | From: "Paul Baker [MVP, Windows - SDK]"
<***@online.rochester.rr.com>
| > | References: <#***@TK2MSFTNGP09.phx.gbl>
| > <***@cpmsftngxa06.phx.gbl>
| > <***@TK2MSFTNGP09.phx.gbl>
| > <***@TK2MSFTNGP11.phx.gbl>
| > <***@TK2MSFTNGP09.phx.gbl>
| > | Subject: Re: Controlling FtpGetFile
| > | Date: Wed, 11 Aug 2004 09:23:47 -0400
| > | Lines: 47
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| > | Message-ID: <***@tk2msftngp13.phx.gbl>
| > | Newsgroups: microsoft.public.inetsdk.programming.wininet
| > | NNTP-Posting-Host: 66-192-38-14.bccsoftware.com 66.192.38.14
| > | Path:
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
| > phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.inetsdk.programming.wininet:11247
| > | X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
| > |
| > | Graham,
| > |
| > | As I said, I am able to use FtpOpenFile to download a file from an FTP
| > | server that does not support the SIZE command (responds with an error
| > like
| > | you describe), so your premise that WinInet cannot be used to
download a
| > | file from an FTP server that does not support the SIZE command is
false.
| > | There is something more going on here.
| > |
| > | I am not sure why Brian from Microsoft would try to steer you away
from
| > his
| > | company's own product, because it works for me and perhaps we just
need
| > some
| > | troubleshooting. I feel like a Microsoft sales rep!
| > |
| > | Paul
| > |
| > | "Gravy" <***@discussions.microsoft.com> wrote in message
| > | news:***@TK2MSFTNGP09.phx.gbl...
| > | > Paul, thanks for your response.
| > | >
| > | > both FtpGetfile and FTPOpenFile issue a SIZE command before the
RETR.
| > | >
| > | > The ftp server returns an error when is comes accross SIZE,
uncognised
| > | > command!
| > | >
| > | > It's looking like I shall have to search out a replacement lib for
| > ftp.
| > | Does
| > | > anyone know of one - one that's free of course ;-)
| > | >
| > | > Graham
| > | >
| > | > "Paul Baker [MVP, Windows - SDK]" <***@online.rochester.rr.com>
| > wrote
| > in
| > | > message news:***@TK2MSFTNGP11.phx.gbl...
| > | > > "Paul Baker [MVP, Windows - SDK]" <***@online.rochester.rr.com>
| > wrote
| > | in
| > | > > message news:***@TK2MSFTNGP09.phx.gbl...
| > | > > [snip]
| > | > > > Maybe I can look at the source code through the MVPSLP.
| > | > >
| > | > >
| > | > > Source code for WinInet is apparently not currently available.
| > | > >
| > | > > Paul
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|
Paul Baker [MVP, Windows - SDK]
2004-08-26 00:20:10 UTC
Permalink
Graham,

You could telnet to the server on port 21 and send the commands manually.
You can then tell us what the response to the SIZE command is, which is
probably the most important factor here. In addition, if you want to try
getting the logs that Brian needs, I would try to isolate it to a simple
program that is not a service.

After some digging, I now understand better what is going on.

FtpOpenFile and FtpGetFile send a SIZE command apparently so that calls to
FtpGetFileSize can return the file size. However, I don't know why it
doesn't simply send the SIZE command when FtpGetFileSize is called and avoid
it otherwise [Problem 1!]. The FtpGetFileSize function is new to IE5, so
this behaviour might only be newer versions of WinInet.

The file size is not used to decide when to stop downloading the file (which
I am glad of).

The trouble is that if the response from the server to the SIZE command is
probably incorrect [Problem 2!]. However, this should not stop FtpOpenFile
and FtpGetFile from succeeding [Problem 3!]. Note that if the response from
the server to the SIZE command is correct, but it just doesn't support the
SIZE command, it seems to work fine.

So, I believe there are 3 problems conspiring against you.

Paul
Post by Brian Combs
Hello
WinInet is not supported for use in a service.
238425 INFO: WinInet Not Supported for Use in Services
http://support.microsoft.com/?id=238425
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Subject: Re: Controlling FtpGetFile
| Date: Mon, 16 Aug 2004 15:40:22 +0100
| Lines: 221
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
Post by Brian Combs
phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11257
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Thanks for the response you guys.
|
| Brian, near the bottom of your last email you had instructions on how to
| start wininet logging, there is one part of this I have a slight problem
|
| ...
| NOTE: If you are using a custome WinInet application you can replace
| IEXPLORE.EXE.LOCAL with your Application file name. And then run your
| application from the command prompt.
| ...
|
| My application that uses WinINet is a C++ service, I hope this doesn't
| complicate matters too much.
|
| Anyway, once I have followed the logging steps I run the service and also
| DebugView (from SysInternals.com) and I get the following message in my
|
| Wininet Assertion Failed: 0
| Source file: g:\n2\inetcore\wininet\urlcache\filemap.cxx
| Source line: 1146
| Thread: 00000be8
|
| and my server then does nothing else, appart from retry eveny 1 minute or
| so.
|
| I'm running XP SP2 with the debug Wininet dll vernion 6.0.2800.1106. have
| you any ideas what wrong??
|
| Thanks for your help
|
| Graham
| > Hello
| > This we do know, WinInet will send the Size command for any of the
| > following commands: FtpOpenFile, FtpGetFile, and FtpCommand with RETR as
| > the command.
| > So I will assume that it depends on how the FTP server response to a
| > command that it does not understand that could cause WinInet to fail.
You
| > can get network trace and WinInet log to see what is going on. Also we
| > know
| > that WinInet is limited for FTP.
| >
| > 172712 INFO: Limitations of WinInet FTP Functions
| > http://support.microsoft.com/?id=172712
| >
| > You can download debug builds of WinInet.Dll from the following
| > ftp://ftp.microsoft.com/PSS/Tools/Developer%20Support%20Tools/WinInet/
| > You should use the build number that is closest to the version of
WinInet
| > that is on your system.
| >
| > On Win ME/ Windows 2000/ Windows XP and greater OSs with Windows File
| > Protection
| >
| > 1. Configure Internet Explorer to use a default Start Page as close to
the
| > page as possible. This eliminates much unnecessary logging that will
add
| > additional size to the output log.
| > 2. Close Internet Explorer as well as any other Internet-based
| > applications
| > (additional applications that use WININET for connectivity may generate
| > extra traffic within the log).
| > 3. Navigate to the location of where Internet Explorer is installed.
| > Typically this is either the \Program Files\Internet Explorer folder or
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| > 4. You must have extensions viewable so that the proper extension is
| > assigned to your file. You can turn on the extensions for all files by
| > going into the Folder Options from within Windows Explorer and choosing
| > the
| > View tab and selecting to 'Show all files' and to not "Hide extensions
of
| > known file types".
| > 5. Create a dummy file out of a new text file. Rename the file to the
| >
| > IEXPLORE.EXE.LOCAL
| >
| > The proper extension for this file is .local If you create this file
and
| > you still have a Notepad icon for the file, re-do step 4 above.
| > 6. Once the file has been created successfully, copy a suitable logging
| > version of WININET.DLL into the same directory as the file you created
in
| > step 5.
| > 7. Once the logging version of WININET is in place, open a CMD prompt.
| > Navigate to the location of where Internet Explorer is installed.
| > Typically this is either the \Program Files\Internet Explorer folder or
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| >
| > SET WININETLOG=1
| >
| > 9. Now that the logging environment variable is set, you can now start
the
| >
| > IEXPLORE.EXE
| >
| > 10. Internet Explorer should now open on the desktop and navigate to the
| > Start Page. It is important that you do not close either the CMD
window
| > or
| > Internet Explorer. As soon as Internet Explorer starts navigation, a
| > WININET.LOG file will be created on the desktop. Do not attempt to open
| > this log while it is being written to.
| > 11. Recreate the problem. Once the behavior is observed, you can now
| > safely close Internet Explorer, as well as the CMD window. Logging
should
| > cease. The log file should be zipped up and forwarded to a support
| > professional that has been trained to read these logs. If the log is
too
| > large to send via Microsoft email (5mb), then it must be placed on the
| > FTPPSS FTP site (ftp://ftppss.microsoft.com)
| > 12. Very Important: once logging is complete, you should remove the
| > logging version of WININET.DLL and the IEXPLORE.EXE.LOCAL file.
Leaving
Post by Brian Combs
| > the logging version of WININET.DLL in place can affect overall browsing
| > performance because of the numerous checks written into that version.
| >
| > TIP: For contrast purposes, it would be advisable to have a log of
the
| > problem occurring and one of a normal condition, if possible. Also, a
| > Network Monitor packet trace that is taken at the same time as the
WININET
| > log may also be beneficial when attempting to correlate network patterns
| > during the WININET communication.
| >
| > NOTE: All of Microsoft's operating systems from Windows 2000 and
forward
| > support the use of IEXPLORE.EXE.LOCAL. This concept is called Dynamic
| > Link
| > Library Redirection and documented online at
http://msdn.microsoft.com.
Post by Brian Combs
| >
| > NOTE: If you are using a custome WinInet application you can replace
| > IEXPLORE.EXE.LOCAL with your Application file name. And then run your
| > application from the command prompt.
| >
| > NOTE: You can change where the log file is saved by setting environment
| > "set wininetlogfile=c:\temp\MyNewLog.log" with out the quotes.
| >
| >
| > Thanks
| > Brian [MSFT]
| > Microsoft Developer Support
| > This posting is provided "AS IS" with no warranties, and confers no
| > rights.
| > --------------------
| > | From: "Paul Baker [MVP, Windows - SDK]"
| > | Subject: Re: Controlling FtpGetFile
| > | Date: Wed, 11 Aug 2004 09:23:47 -0400
| > | Lines: 47
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| > | Newsgroups: microsoft.public.inetsdk.programming.wininet
| > | NNTP-Posting-Host: 66-192-38-14.bccsoftware.com 66.192.38.14
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
Post by Brian Combs
| > phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.inetsdk.programming.wininet:11247
| > | X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
| > |
| > | Graham,
| > |
| > | As I said, I am able to use FtpOpenFile to download a file from an FTP
| > | server that does not support the SIZE command (responds with an error
| > like
| > | you describe), so your premise that WinInet cannot be used to
download a
| > | file from an FTP server that does not support the SIZE command is
false.
| > | There is something more going on here.
| > |
| > | I am not sure why Brian from Microsoft would try to steer you away
from
| > his
| > | company's own product, because it works for me and perhaps we just
need
| > some
| > | troubleshooting. I feel like a Microsoft sales rep!
| > |
| > | Paul
| > |
| > | > Paul, thanks for your response.
| > | >
| > | > both FtpGetfile and FTPOpenFile issue a SIZE command before the
RETR.
| > | >
| > | > The ftp server returns an error when is comes accross SIZE,
uncognised
| > | > command!
| > | >
| > | > It's looking like I shall have to search out a replacement lib for
| > ftp.
| > | Does
| > | > anyone know of one - one that's free of course ;-)
| > | >
| > | > Graham
| > | >
| > in
| > | > > "Paul Baker [MVP, Windows - SDK]"
| > | in
| > | > > [snip]
| > | > > > Maybe I can look at the source code through the MVPSLP.
| > | > >
| > | > >
| > | > > Source code for WinInet is apparently not currently available.
| > | > >
| > | > > Paul
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|
Gravy
2004-09-01 09:02:51 UTC
Permalink
Thanks for the response Paul.

Telnetting to the server on port21 would be interesting, normally (using
FTP) I have to first authenticate with a proxy then send the USER commend to
log in to the ftp server, then I can send the size command. I'm sure that
when I was monitoring the FTP session last time I received an error code of
500, command not understood.

What sort of response would cause GetFtpFile (or something similar) to fail?

Graham
Post by Paul Baker [MVP, Windows - SDK]
Graham,
You could telnet to the server on port 21 and send the commands manually.
You can then tell us what the response to the SIZE command is, which is
probably the most important factor here. In addition, if you want to try
getting the logs that Brian needs, I would try to isolate it to a simple
program that is not a service.
After some digging, I now understand better what is going on.
FtpOpenFile and FtpGetFile send a SIZE command apparently so that calls to
FtpGetFileSize can return the file size. However, I don't know why it
doesn't simply send the SIZE command when FtpGetFileSize is called and avoid
it otherwise [Problem 1!]. The FtpGetFileSize function is new to IE5, so
this behaviour might only be newer versions of WinInet.
The file size is not used to decide when to stop downloading the file (which
I am glad of).
The trouble is that if the response from the server to the SIZE command is
probably incorrect [Problem 2!]. However, this should not stop FtpOpenFile
and FtpGetFile from succeeding [Problem 3!]. Note that if the response from
the server to the SIZE command is correct, but it just doesn't support the
SIZE command, it seems to work fine.
So, I believe there are 3 problems conspiring against you.
Paul
Post by Brian Combs
Hello
WinInet is not supported for use in a service.
238425 INFO: WinInet Not Supported for Use in Services
http://support.microsoft.com/?id=238425
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no
rights.
Post by Brian Combs
--------------------
| Subject: Re: Controlling FtpGetFile
| Date: Mon, 16 Aug 2004 15:40:22 +0100
| Lines: 221
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
Post by Brian Combs
phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11257
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Thanks for the response you guys.
|
| Brian, near the bottom of your last email you had instructions on how to
| start wininet logging, there is one part of this I have a slight problem
|
| ...
| NOTE: If you are using a custome WinInet application you can replace
| IEXPLORE.EXE.LOCAL with your Application file name. And then run your
| application from the command prompt.
| ...
|
| My application that uses WinINet is a C++ service, I hope this doesn't
| complicate matters too much.
|
| Anyway, once I have followed the logging steps I run the service and
also
Post by Brian Combs
| DebugView (from SysInternals.com) and I get the following message in my
|
| Wininet Assertion Failed: 0
| Source file: g:\n2\inetcore\wininet\urlcache\filemap.cxx
| Source line: 1146
| Thread: 00000be8
|
| and my server then does nothing else, appart from retry eveny 1 minute
or
Post by Brian Combs
| so.
|
| I'm running XP SP2 with the debug Wininet dll vernion 6.0.2800.1106.
have
Post by Brian Combs
| you any ideas what wrong??
|
| Thanks for your help
|
| Graham
| > Hello
| > This we do know, WinInet will send the Size command for any of the
| > following commands: FtpOpenFile, FtpGetFile, and FtpCommand with RETR
as
Post by Brian Combs
| > the command.
| > So I will assume that it depends on how the FTP server response to a
| > command that it does not understand that could cause WinInet to fail.
You
| > can get network trace and WinInet log to see what is going on. Also we
| > know
| > that WinInet is limited for FTP.
| >
| > 172712 INFO: Limitations of WinInet FTP Functions
| > http://support.microsoft.com/?id=172712
| >
| > You can download debug builds of WinInet.Dll from the following
| >
ftp://ftp.microsoft.com/PSS/Tools/Developer%20Support%20Tools/WinInet/
| > You should use the build number that is closest to the version of
WinInet
| > that is on your system.
| >
| > On Win ME/ Windows 2000/ Windows XP and greater OSs with Windows File
| > Protection
| >
| > 1. Configure Internet Explorer to use a default Start Page as close to
the
| > page as possible. This eliminates much unnecessary logging that will
add
| > additional size to the output log.
| > 2. Close Internet Explorer as well as any other Internet-based
| > applications
| > (additional applications that use WININET for connectivity may
generate
Post by Brian Combs
| > extra traffic within the log).
| > 3. Navigate to the location of where Internet Explorer is installed.
| > Typically this is either the \Program Files\Internet Explorer folder
or
Post by Brian Combs
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| > 4. You must have extensions viewable so that the proper extension is
| > assigned to your file. You can turn on the extensions for all files
by
Post by Brian Combs
| > going into the Folder Options from within Windows Explorer and
choosing
Post by Brian Combs
| > the
| > View tab and selecting to 'Show all files' and to not "Hide extensions
of
| > known file types".
| > 5. Create a dummy file out of a new text file. Rename the file to
the
Post by Brian Combs
| >
| > IEXPLORE.EXE.LOCAL
| >
| > The proper extension for this file is .local If you create this file
and
| > you still have a Notepad icon for the file, re-do step 4 above.
| > 6. Once the file has been created successfully, copy a suitable
logging
Post by Brian Combs
| > version of WININET.DLL into the same directory as the file you created
in
| > step 5.
| > 7. Once the logging version of WININET is in place, open a CMD prompt.
| > Navigate to the location of where Internet Explorer is installed.
| > Typically this is either the \Program Files\Internet Explorer folder
or
Post by Brian Combs
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| >
| > SET WININETLOG=1
| >
| > 9. Now that the logging environment variable is set, you can now start
the
| >
| > IEXPLORE.EXE
| >
| > 10. Internet Explorer should now open on the desktop and navigate to
the
Post by Brian Combs
| > Start Page. It is important that you do not close either the CMD
window
| > or
| > Internet Explorer. As soon as Internet Explorer starts navigation, a
| > WININET.LOG file will be created on the desktop. Do not attempt to
open
Post by Brian Combs
| > this log while it is being written to.
| > 11. Recreate the problem. Once the behavior is observed, you can now
| > safely close Internet Explorer, as well as the CMD window. Logging
should
| > cease. The log file should be zipped up and forwarded to a support
| > professional that has been trained to read these logs. If the log is
too
| > large to send via Microsoft email (5mb), then it must be placed on the
| > FTPPSS FTP site (ftp://ftppss.microsoft.com)
| > 12. Very Important: once logging is complete, you should remove the
| > logging version of WININET.DLL and the IEXPLORE.EXE.LOCAL file.
Leaving
Post by Brian Combs
| > the logging version of WININET.DLL in place can affect overall
browsing
Post by Brian Combs
| > performance because of the numerous checks written into that version.
| >
| > TIP: For contrast purposes, it would be advisable to have a log of
the
| > problem occurring and one of a normal condition, if possible. Also,
a
Post by Brian Combs
| > Network Monitor packet trace that is taken at the same time as the
WININET
| > log may also be beneficial when attempting to correlate network
patterns
Post by Brian Combs
| > during the WININET communication.
| >
| > NOTE: All of Microsoft's operating systems from Windows 2000 and
forward
| > support the use of IEXPLORE.EXE.LOCAL. This concept is called Dynamic
| > Link
| > Library Redirection and documented online at
http://msdn.microsoft.com.
Post by Brian Combs
| >
| > NOTE: If you are using a custome WinInet application you can replace
| > IEXPLORE.EXE.LOCAL with your Application file name. And then run your
| > application from the command prompt.
| >
| > NOTE: You can change where the log file is saved by setting
environment
Post by Brian Combs
| > "set wininetlogfile=c:\temp\MyNewLog.log" with out the quotes.
| >
| >
| > Thanks
| > Brian [MSFT]
| > Microsoft Developer Support
| > This posting is provided "AS IS" with no warranties, and confers no
| > rights.
| > --------------------
| > | From: "Paul Baker [MVP, Windows - SDK]"
| > | Subject: Re: Controlling FtpGetFile
| > | Date: Wed, 11 Aug 2004 09:23:47 -0400
| > | Lines: 47
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| > | Newsgroups: microsoft.public.inetsdk.programming.wininet
| > | NNTP-Posting-Host: 66-192-38-14.bccsoftware.com 66.192.38.14
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
Post by Brian Combs
| > phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.inetsdk.programming.wininet:11247
| > | X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
| > |
| > | Graham,
| > |
| > | As I said, I am able to use FtpOpenFile to download a file from an
FTP
Post by Brian Combs
| > | server that does not support the SIZE command (responds with an
error
Post by Brian Combs
| > like
| > | you describe), so your premise that WinInet cannot be used to
download a
| > | file from an FTP server that does not support the SIZE command is
false.
| > | There is something more going on here.
| > |
| > | I am not sure why Brian from Microsoft would try to steer you away
from
| > his
| > | company's own product, because it works for me and perhaps we just
need
| > some
| > | troubleshooting. I feel like a Microsoft sales rep!
| > |
| > | Paul
| > |
| > | > Paul, thanks for your response.
| > | >
| > | > both FtpGetfile and FTPOpenFile issue a SIZE command before the
RETR.
| > | >
| > | > The ftp server returns an error when is comes accross SIZE,
uncognised
| > | > command!
| > | >
| > | > It's looking like I shall have to search out a replacement lib for
| > ftp.
| > | Does
| > | > anyone know of one - one that's free of course ;-)
| > | >
| > | > Graham
| > | >
| > in
| > | > > "Paul Baker [MVP, Windows - SDK]"
| > | in
| > | > > [snip]
| > | > > > Maybe I can look at the source code through the MVPSLP.
| > | > >
| > | > >
| > | > > Source code for WinInet is apparently not currently available.
| > | > >
| > | > > Paul
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|
Paul Baker [MVP, Windows - SDK]
2004-09-01 14:27:36 UTC
Permalink
I don't know what kind of response would be a problem, maybe Brian does.

Maybe you should use telnet to send USER, PASS and SIZE commands to the FTP
server and send us a log of the response. Was it really "500, command not
understood"? I am not sure if the comma is right.

Do you have a simple test program that uses WinInet and exhibits the
problem, and a corresponding log that Brian asked for?

Paul
Post by Gravy
Thanks for the response Paul.
Telnetting to the server on port21 would be interesting, normally (using
FTP) I have to first authenticate with a proxy then send the USER commend to
log in to the ftp server, then I can send the size command. I'm sure that
when I was monitoring the FTP session last time I received an error code of
500, command not understood.
What sort of response would cause GetFtpFile (or something similar) to fail?
Graham
Post by Paul Baker [MVP, Windows - SDK]
Graham,
You could telnet to the server on port 21 and send the commands manually.
You can then tell us what the response to the SIZE command is, which is
probably the most important factor here. In addition, if you want to try
getting the logs that Brian needs, I would try to isolate it to a simple
program that is not a service.
After some digging, I now understand better what is going on.
FtpOpenFile and FtpGetFile send a SIZE command apparently so that calls to
FtpGetFileSize can return the file size. However, I don't know why it
doesn't simply send the SIZE command when FtpGetFileSize is called and avoid
it otherwise [Problem 1!]. The FtpGetFileSize function is new to IE5, so
this behaviour might only be newer versions of WinInet.
The file size is not used to decide when to stop downloading the file (which
I am glad of).
The trouble is that if the response from the server to the SIZE command is
probably incorrect [Problem 2!]. However, this should not stop FtpOpenFile
and FtpGetFile from succeeding [Problem 3!]. Note that if the response from
the server to the SIZE command is correct, but it just doesn't support the
SIZE command, it seems to work fine.
So, I believe there are 3 problems conspiring against you.
Paul
Post by Brian Combs
Hello
WinInet is not supported for use in a service.
238425 INFO: WinInet Not Supported for Use in Services
http://support.microsoft.com/?id=238425
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no
rights.
Post by Brian Combs
--------------------
| Subject: Re: Controlling FtpGetFile
| Date: Mon, 16 Aug 2004 15:40:22 +0100
| Lines: 221
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11257
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Thanks for the response you guys.
|
| Brian, near the bottom of your last email you had instructions on how to
| start wininet logging, there is one part of this I have a slight problem
|
| ...
| NOTE: If you are using a custome WinInet application you can replace
| IEXPLORE.EXE.LOCAL with your Application file name. And then run your
| application from the command prompt.
| ...
|
| My application that uses WinINet is a C++ service, I hope this doesn't
| complicate matters too much.
|
| Anyway, once I have followed the logging steps I run the service and
also
Post by Brian Combs
| DebugView (from SysInternals.com) and I get the following message in my
|
| Wininet Assertion Failed: 0
| Source file: g:\n2\inetcore\wininet\urlcache\filemap.cxx
| Source line: 1146
| Thread: 00000be8
|
| and my server then does nothing else, appart from retry eveny 1 minute
or
Post by Brian Combs
| so.
|
| I'm running XP SP2 with the debug Wininet dll vernion 6.0.2800.1106.
have
Post by Brian Combs
| you any ideas what wrong??
|
| Thanks for your help
|
| Graham
| > Hello
| > This we do know, WinInet will send the Size command for any of the
| > following commands: FtpOpenFile, FtpGetFile, and FtpCommand with RETR
as
Post by Brian Combs
| > the command.
| > So I will assume that it depends on how the FTP server response to a
| > command that it does not understand that could cause WinInet to fail.
You
| > can get network trace and WinInet log to see what is going on. Also we
| > know
| > that WinInet is limited for FTP.
| >
| > 172712 INFO: Limitations of WinInet FTP Functions
| > http://support.microsoft.com/?id=172712
| >
| > You can download debug builds of WinInet.Dll from the following
| >
ftp://ftp.microsoft.com/PSS/Tools/Developer%20Support%20Tools/WinInet/
| > You should use the build number that is closest to the version of
WinInet
| > that is on your system.
| >
| > On Win ME/ Windows 2000/ Windows XP and greater OSs with Windows File
| > Protection
| >
| > 1. Configure Internet Explorer to use a default Start Page as close to
the
| > page as possible. This eliminates much unnecessary logging that will
add
| > additional size to the output log.
| > 2. Close Internet Explorer as well as any other Internet-based
| > applications
| > (additional applications that use WININET for connectivity may
generate
Post by Brian Combs
| > extra traffic within the log).
| > 3. Navigate to the location of where Internet Explorer is installed.
| > Typically this is either the \Program Files\Internet Explorer folder
or
Post by Brian Combs
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| > 4. You must have extensions viewable so that the proper extension is
| > assigned to your file. You can turn on the extensions for all files
by
Post by Brian Combs
| > going into the Folder Options from within Windows Explorer and
choosing
Post by Brian Combs
| > the
| > View tab and selecting to 'Show all files' and to not "Hide extensions
of
| > known file types".
| > 5. Create a dummy file out of a new text file. Rename the file to
the
Post by Brian Combs
| >
| > IEXPLORE.EXE.LOCAL
| >
| > The proper extension for this file is .local If you create this file
and
| > you still have a Notepad icon for the file, re-do step 4 above.
| > 6. Once the file has been created successfully, copy a suitable
logging
Post by Brian Combs
| > version of WININET.DLL into the same directory as the file you created
in
| > step 5.
| > 7. Once the logging version of WININET is in place, open a CMD prompt.
| > Navigate to the location of where Internet Explorer is installed.
| > Typically this is either the \Program Files\Internet Explorer folder
or
Post by Brian Combs
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| >
| > SET WININETLOG=1
| >
| > 9. Now that the logging environment variable is set, you can now start
the
| >
| > IEXPLORE.EXE
| >
| > 10. Internet Explorer should now open on the desktop and navigate to
the
Post by Brian Combs
| > Start Page. It is important that you do not close either the CMD
window
| > or
| > Internet Explorer. As soon as Internet Explorer starts navigation, a
| > WININET.LOG file will be created on the desktop. Do not attempt to
open
Post by Brian Combs
| > this log while it is being written to.
| > 11. Recreate the problem. Once the behavior is observed, you can now
| > safely close Internet Explorer, as well as the CMD window. Logging
should
| > cease. The log file should be zipped up and forwarded to a support
| > professional that has been trained to read these logs. If the log is
too
| > large to send via Microsoft email (5mb), then it must be placed on the
| > FTPPSS FTP site (ftp://ftppss.microsoft.com)
| > 12. Very Important: once logging is complete, you should remove the
| > logging version of WININET.DLL and the IEXPLORE.EXE.LOCAL file.
Leaving
Post by Brian Combs
| > the logging version of WININET.DLL in place can affect overall
browsing
Post by Brian Combs
| > performance because of the numerous checks written into that version.
| >
| > TIP: For contrast purposes, it would be advisable to have a log of
the
| > problem occurring and one of a normal condition, if possible.
Also,
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
a
Post by Brian Combs
| > Network Monitor packet trace that is taken at the same time as the
WININET
| > log may also be beneficial when attempting to correlate network
patterns
Post by Brian Combs
| > during the WININET communication.
| >
| > NOTE: All of Microsoft's operating systems from Windows 2000 and
forward
| > support the use of IEXPLORE.EXE.LOCAL. This concept is called Dynamic
| > Link
| > Library Redirection and documented online at
http://msdn.microsoft.com.
Post by Brian Combs
| >
| > NOTE: If you are using a custome WinInet application you can replace
| > IEXPLORE.EXE.LOCAL with your Application file name. And then run your
| > application from the command prompt.
| >
| > NOTE: You can change where the log file is saved by setting
environment
Post by Brian Combs
| > "set wininetlogfile=c:\temp\MyNewLog.log" with out the quotes.
| >
| >
| > Thanks
| > Brian [MSFT]
| > Microsoft Developer Support
| > This posting is provided "AS IS" with no warranties, and confers no
| > rights.
| > --------------------
| > | From: "Paul Baker [MVP, Windows - SDK]"
| > | Subject: Re: Controlling FtpGetFile
| > | Date: Wed, 11 Aug 2004 09:23:47 -0400
| > | Lines: 47
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| > | Newsgroups: microsoft.public.inetsdk.programming.wininet
| > | NNTP-Posting-Host: 66-192-38-14.bccsoftware.com 66.192.38.14
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.inetsdk.programming.wininet:11247
| > | X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
| > |
| > | Graham,
| > |
| > | As I said, I am able to use FtpOpenFile to download a file from an
FTP
Post by Brian Combs
| > | server that does not support the SIZE command (responds with an
error
Post by Brian Combs
| > like
| > | you describe), so your premise that WinInet cannot be used to
download a
| > | file from an FTP server that does not support the SIZE command is
false.
| > | There is something more going on here.
| > |
| > | I am not sure why Brian from Microsoft would try to steer you away
from
| > his
| > | company's own product, because it works for me and perhaps we just
need
| > some
| > | troubleshooting. I feel like a Microsoft sales rep!
| > |
| > | Paul
| > |
| > | > Paul, thanks for your response.
| > | >
| > | > both FtpGetfile and FTPOpenFile issue a SIZE command before the
RETR.
| > | >
| > | > The ftp server returns an error when is comes accross SIZE,
uncognised
| > | > command!
| > | >
| > | > It's looking like I shall have to search out a replacement lib for
| > ftp.
| > | Does
| > | > anyone know of one - one that's free of course ;-)
| > | >
| > | > Graham
| > | >
| > | > "Paul Baker [MVP, Windows - SDK]"
| > in
| > | > > "Paul Baker [MVP, Windows - SDK]"
| > | in
| > | > > [snip]
| > | > > > Maybe I can look at the source code through the MVPSLP.
| > | > >
| > | > >
| > | > > Source code for WinInet is apparently not currently available.
| > | > >
| > | > > Paul
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|
Gravy
2004-09-02 07:23:44 UTC
Permalink
Sorry, the comma was added by me, I just tried it again.

As for a sample program, this may be a little hard because of other time
constraints but I shall try my hardest to get it done.

One thing is confusing me though. Easlier on in the post I was advised not
to use WinINet in a service but to consider WinHttp instead. However, the
docs for WinHttp suggests that you don't use it for FTP access
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winhttp/http/porting_wininet_applications_to_winhttp.asp.
If that is the case was technology could I use?

I have been thinking about using the command line FTP.EXE. The service could
create a command file at runtime and shell out to FTP.EXE giving it the
newly created command file. I've tried it and it works but what are issues?
Anyone know?

Regards

Graham
Post by Paul Baker [MVP, Windows - SDK]
I don't know what kind of response would be a problem, maybe Brian does.
Maybe you should use telnet to send USER, PASS and SIZE commands to the FTP
server and send us a log of the response. Was it really "500, command not
understood"? I am not sure if the comma is right.
Do you have a simple test program that uses WinInet and exhibits the
problem, and a corresponding log that Brian asked for?
Paul
Post by Gravy
Thanks for the response Paul.
Telnetting to the server on port21 would be interesting, normally (using
FTP) I have to first authenticate with a proxy then send the USER commend
to
Post by Gravy
log in to the ftp server, then I can send the size command. I'm sure that
when I was monitoring the FTP session last time I received an error code
of
Post by Gravy
500, command not understood.
What sort of response would cause GetFtpFile (or something similar) to
fail?
Post by Gravy
Graham
Post by Paul Baker [MVP, Windows - SDK]
Graham,
You could telnet to the server on port 21 and send the commands
manually.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
You can then tell us what the response to the SIZE command is, which is
probably the most important factor here. In addition, if you want to try
getting the logs that Brian needs, I would try to isolate it to a simple
program that is not a service.
After some digging, I now understand better what is going on.
FtpOpenFile and FtpGetFile send a SIZE command apparently so that calls
to
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
FtpGetFileSize can return the file size. However, I don't know why it
doesn't simply send the SIZE command when FtpGetFileSize is called and avoid
it otherwise [Problem 1!]. The FtpGetFileSize function is new to IE5, so
this behaviour might only be newer versions of WinInet.
The file size is not used to decide when to stop downloading the file (which
I am glad of).
The trouble is that if the response from the server to the SIZE command
is
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
probably incorrect [Problem 2!]. However, this should not stop
FtpOpenFile
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
and FtpGetFile from succeeding [Problem 3!]. Note that if the response from
the server to the SIZE command is correct, but it just doesn't support
the
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
SIZE command, it seems to work fine.
So, I believe there are 3 problems conspiring against you.
Paul
Post by Brian Combs
Hello
WinInet is not supported for use in a service.
238425 INFO: WinInet Not Supported for Use in Services
http://support.microsoft.com/?id=238425
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no
rights.
Post by Brian Combs
--------------------
| Subject: Re: Controlling FtpGetFile
| Date: Mon, 16 Aug 2004 15:40:22 +0100
| Lines: 221
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11257
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Thanks for the response you guys.
|
| Brian, near the bottom of your last email you had instructions on
how
to
| start wininet logging, there is one part of this I have a slight problem
|
| ...
| NOTE: If you are using a custome WinInet application you can replace
| IEXPLORE.EXE.LOCAL with your Application file name. And then run
your
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| application from the command prompt.
| ...
|
| My application that uses WinINet is a C++ service, I hope this
doesn't
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| complicate matters too much.
|
| Anyway, once I have followed the logging steps I run the service and
also
Post by Brian Combs
| DebugView (from SysInternals.com) and I get the following message in
my
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
|
| Wininet Assertion Failed: 0
| Source file: g:\n2\inetcore\wininet\urlcache\filemap.cxx
| Source line: 1146
| Thread: 00000be8
|
| and my server then does nothing else, appart from retry eveny 1
minute
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
or
Post by Brian Combs
| so.
|
| I'm running XP SP2 with the debug Wininet dll vernion 6.0.2800.1106.
have
Post by Brian Combs
| you any ideas what wrong??
|
| Thanks for your help
|
| Graham
| > Hello
| > This we do know, WinInet will send the Size command for any of the
| > following commands: FtpOpenFile, FtpGetFile, and FtpCommand with
RETR
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
as
Post by Brian Combs
| > the command.
| > So I will assume that it depends on how the FTP server response to
a
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > command that it does not understand that could cause WinInet to
fail.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
You
| > can get network trace and WinInet log to see what is going on.
Also
we
| > know
| > that WinInet is limited for FTP.
| >
| > 172712 INFO: Limitations of WinInet FTP Functions
| > http://support.microsoft.com/?id=172712
| >
| > You can download debug builds of WinInet.Dll from the following
| >
ftp://ftp.microsoft.com/PSS/Tools/Developer%20Support%20Tools/WinInet/
| > You should use the build number that is closest to the version of
WinInet
| > that is on your system.
| >
| > On Win ME/ Windows 2000/ Windows XP and greater OSs with Windows
File
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > Protection
| >
| > 1. Configure Internet Explorer to use a default Start Page as
close
to
the
| > page as possible. This eliminates much unnecessary logging that
will
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
add
| > additional size to the output log.
| > 2. Close Internet Explorer as well as any other Internet-based
| > applications
| > (additional applications that use WININET for connectivity may
generate
Post by Brian Combs
| > extra traffic within the log).
| > 3. Navigate to the location of where Internet Explorer is
installed.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > Typically this is either the \Program Files\Internet Explorer
folder
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
or
Post by Brian Combs
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| > 4. You must have extensions viewable so that the proper extension
is
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > assigned to your file. You can turn on the extensions for all
files
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
by
Post by Brian Combs
| > going into the Folder Options from within Windows Explorer and
choosing
Post by Brian Combs
| > the
| > View tab and selecting to 'Show all files' and to not "Hide extensions
of
| > known file types".
| > 5. Create a dummy file out of a new text file. Rename the file to
the
Post by Brian Combs
| >
| > IEXPLORE.EXE.LOCAL
| >
| > The proper extension for this file is .local If you create this file
and
| > you still have a Notepad icon for the file, re-do step 4 above.
| > 6. Once the file has been created successfully, copy a suitable
logging
Post by Brian Combs
| > version of WININET.DLL into the same directory as the file you created
in
| > step 5.
| > 7. Once the logging version of WININET is in place, open a CMD prompt.
| > Navigate to the location of where Internet Explorer is installed.
| > Typically this is either the \Program Files\Internet Explorer
folder
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
or
Post by Brian Combs
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| >
| > SET WININETLOG=1
| >
| > 9. Now that the logging environment variable is set, you can now start
the
| >
| > IEXPLORE.EXE
| >
| > 10. Internet Explorer should now open on the desktop and navigate
to
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
the
Post by Brian Combs
| > Start Page. It is important that you do not close either the CMD
window
| > or
| > Internet Explorer. As soon as Internet Explorer starts
navigation,
a
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > WININET.LOG file will be created on the desktop. Do not attempt to
open
Post by Brian Combs
| > this log while it is being written to.
| > 11. Recreate the problem. Once the behavior is observed, you can
now
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > safely close Internet Explorer, as well as the CMD window.
Logging
should
| > cease. The log file should be zipped up and forwarded to a support
| > professional that has been trained to read these logs. If the log
is
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
too
| > large to send via Microsoft email (5mb), then it must be placed on the
| > FTPPSS FTP site (ftp://ftppss.microsoft.com)
| > 12. Very Important: once logging is complete, you should remove
the
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > logging version of WININET.DLL and the IEXPLORE.EXE.LOCAL file.
Leaving
Post by Brian Combs
| > the logging version of WININET.DLL in place can affect overall
browsing
Post by Brian Combs
| > performance because of the numerous checks written into that
version.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| >
| > TIP: For contrast purposes, it would be advisable to have a
log
of
the
| > problem occurring and one of a normal condition, if possible.
Also,
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
a
Post by Brian Combs
| > Network Monitor packet trace that is taken at the same time as the
WININET
| > log may also be beneficial when attempting to correlate network
patterns
Post by Brian Combs
| > during the WININET communication.
| >
| > NOTE: All of Microsoft's operating systems from Windows 2000 and
forward
| > support the use of IEXPLORE.EXE.LOCAL. This concept is called Dynamic
| > Link
| > Library Redirection and documented online at
http://msdn.microsoft.com.
Post by Brian Combs
| >
| > NOTE: If you are using a custome WinInet application you can
replace
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > IEXPLORE.EXE.LOCAL with your Application file name. And then run your
| > application from the command prompt.
| >
| > NOTE: You can change where the log file is saved by setting
environment
Post by Brian Combs
| > "set wininetlogfile=c:\temp\MyNewLog.log" with out the quotes.
| >
| >
| > Thanks
| > Brian [MSFT]
| > Microsoft Developer Support
| > This posting is provided "AS IS" with no warranties, and confers no
| > rights.
| > --------------------
| > | From: "Paul Baker [MVP, Windows - SDK]"
| > | Subject: Re: Controlling FtpGetFile
| > | Date: Wed, 11 Aug 2004 09:23:47 -0400
| > | Lines: 47
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| > | Newsgroups: microsoft.public.inetsdk.programming.wininet
| > | NNTP-Posting-Host: 66-192-38-14.bccsoftware.com 66.192.38.14
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.inetsdk.programming.wininet:11247
| > | X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
| > |
| > | Graham,
| > |
| > | As I said, I am able to use FtpOpenFile to download a file from
an
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
FTP
Post by Brian Combs
| > | server that does not support the SIZE command (responds with an
error
Post by Brian Combs
| > like
| > | you describe), so your premise that WinInet cannot be used to
download a
| > | file from an FTP server that does not support the SIZE command is
false.
| > | There is something more going on here.
| > |
| > | I am not sure why Brian from Microsoft would try to steer you
away
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
from
| > his
| > | company's own product, because it works for me and perhaps we
just
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
need
| > some
| > | troubleshooting. I feel like a Microsoft sales rep!
| > |
| > | Paul
| > |
| > | > Paul, thanks for your response.
| > | >
| > | > both FtpGetfile and FTPOpenFile issue a SIZE command before the
RETR.
| > | >
| > | > The ftp server returns an error when is comes accross SIZE,
uncognised
| > | > command!
| > | >
| > | > It's looking like I shall have to search out a replacement lib for
| > ftp.
| > | Does
| > | > anyone know of one - one that's free of course ;-)
| > | >
| > | > Graham
| > | >
| > | > "Paul Baker [MVP, Windows - SDK]"
| > in
| > | > > "Paul Baker [MVP, Windows - SDK]"
| > | in
| > | > > [snip]
| > | > > > Maybe I can look at the source code through the MVPSLP.
| > | > >
| > | > >
| > | > > Source code for WinInet is apparently not currently
available.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > | > >
| > | > > Paul
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|
Paul Baker [MVP, Windows - SDK]
2004-09-02 14:33:14 UTC
Permalink
WinInet should not be used in a service. If you choose to use it, you are in
an unsupported situation. I would guess that FTP is safer than HTTP though.
It does not have the complications of caching, cookies, user prompts and so
on all of which depend on a logged in user, which I suspect is the big
reason that it is not supported. So if you want to, you may be able to get
it to work.

WinHTTP supports only HTTP, that's right.

I guess creating an FTP.EXE process is fine.

It's up to you whether you want to take the time to figure out what the
problem with WinInet is. But it will take time. I would try taking the same
exact code, removing fluff and putting in a test program that Win32 native
EXE and NOT a service. This will eliminate the possibility of it being a
service.

Also, you could try other FTP servers, such as ones you know DO support the
SIZE command.

It's really up to you how oyu want to proceed. But we need more factual
details and troubleshooting from you.

Paul
Post by Gravy
Sorry, the comma was added by me, I just tried it again.
As for a sample program, this may be a little hard because of other time
constraints but I shall try my hardest to get it done.
One thing is confusing me though. Easlier on in the post I was advised not
to use WinINet in a service but to consider WinHttp instead. However, the
docs for WinHttp suggests that you don't use it for FTP access
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winhttp/http/porting_wininet_applications_to_winhttp.asp.
Post by Gravy
If that is the case was technology could I use?
I have been thinking about using the command line FTP.EXE. The service could
create a command file at runtime and shell out to FTP.EXE giving it the
newly created command file. I've tried it and it works but what are issues?
Anyone know?
Regards
Graham
Post by Paul Baker [MVP, Windows - SDK]
I don't know what kind of response would be a problem, maybe Brian does.
Maybe you should use telnet to send USER, PASS and SIZE commands to the FTP
server and send us a log of the response. Was it really "500, command not
understood"? I am not sure if the comma is right.
Do you have a simple test program that uses WinInet and exhibits the
problem, and a corresponding log that Brian asked for?
Paul
Post by Gravy
Thanks for the response Paul.
Telnetting to the server on port21 would be interesting, normally (using
FTP) I have to first authenticate with a proxy then send the USER commend
to
Post by Gravy
log in to the ftp server, then I can send the size command. I'm sure that
when I was monitoring the FTP session last time I received an error code
of
Post by Gravy
500, command not understood.
What sort of response would cause GetFtpFile (or something similar) to
fail?
Post by Gravy
Graham
Post by Paul Baker [MVP, Windows - SDK]
Graham,
You could telnet to the server on port 21 and send the commands
manually.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
You can then tell us what the response to the SIZE command is, which is
probably the most important factor here. In addition, if you want to try
getting the logs that Brian needs, I would try to isolate it to a simple
program that is not a service.
After some digging, I now understand better what is going on.
FtpOpenFile and FtpGetFile send a SIZE command apparently so that calls
to
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
FtpGetFileSize can return the file size. However, I don't know why it
doesn't simply send the SIZE command when FtpGetFileSize is called
and
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
avoid
it otherwise [Problem 1!]. The FtpGetFileSize function is new to IE5, so
this behaviour might only be newer versions of WinInet.
The file size is not used to decide when to stop downloading the file (which
I am glad of).
The trouble is that if the response from the server to the SIZE command
is
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
probably incorrect [Problem 2!]. However, this should not stop
FtpOpenFile
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
and FtpGetFile from succeeding [Problem 3!]. Note that if the
response
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
from
the server to the SIZE command is correct, but it just doesn't support
the
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
SIZE command, it seems to work fine.
So, I believe there are 3 problems conspiring against you.
Paul
Post by Brian Combs
Hello
WinInet is not supported for use in a service.
238425 INFO: WinInet Not Supported for Use in Services
http://support.microsoft.com/?id=238425
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no
rights.
Post by Brian Combs
--------------------
| Subject: Re: Controlling FtpGetFile
| Date: Mon, 16 Aug 2004 15:40:22 +0100
| Lines: 221
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11257
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Thanks for the response you guys.
|
| Brian, near the bottom of your last email you had instructions on
how
to
| start wininet logging, there is one part of this I have a slight problem
|
| ...
| NOTE: If you are using a custome WinInet application you can replace
| IEXPLORE.EXE.LOCAL with your Application file name. And then run
your
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| application from the command prompt.
| ...
|
| My application that uses WinINet is a C++ service, I hope this
doesn't
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| complicate matters too much.
|
| Anyway, once I have followed the logging steps I run the service and
also
Post by Brian Combs
| DebugView (from SysInternals.com) and I get the following message in
my
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
|
| Wininet Assertion Failed: 0
| Source file: g:\n2\inetcore\wininet\urlcache\filemap.cxx
| Source line: 1146
| Thread: 00000be8
|
| and my server then does nothing else, appart from retry eveny 1
minute
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
or
Post by Brian Combs
| so.
|
| I'm running XP SP2 with the debug Wininet dll vernion
6.0.2800.1106.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
have
Post by Brian Combs
| you any ideas what wrong??
|
| Thanks for your help
|
| Graham
| > Hello
| > This we do know, WinInet will send the Size command for any of the
| > following commands: FtpOpenFile, FtpGetFile, and FtpCommand with
RETR
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
as
Post by Brian Combs
| > the command.
| > So I will assume that it depends on how the FTP server response to
a
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > command that it does not understand that could cause WinInet to
fail.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
You
| > can get network trace and WinInet log to see what is going on.
Also
we
| > know
| > that WinInet is limited for FTP.
| >
| > 172712 INFO: Limitations of WinInet FTP Functions
| > http://support.microsoft.com/?id=172712
| >
| > You can download debug builds of WinInet.Dll from the following
| >
ftp://ftp.microsoft.com/PSS/Tools/Developer%20Support%20Tools/WinInet/
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > You should use the build number that is closest to the version of
WinInet
| > that is on your system.
| >
| > On Win ME/ Windows 2000/ Windows XP and greater OSs with Windows
File
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > Protection
| >
| > 1. Configure Internet Explorer to use a default Start Page as
close
to
the
| > page as possible. This eliminates much unnecessary logging that
will
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
add
| > additional size to the output log.
| > 2. Close Internet Explorer as well as any other Internet-based
| > applications
| > (additional applications that use WININET for connectivity may
generate
Post by Brian Combs
| > extra traffic within the log).
| > 3. Navigate to the location of where Internet Explorer is
installed.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > Typically this is either the \Program Files\Internet Explorer
folder
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
or
Post by Brian Combs
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| > 4. You must have extensions viewable so that the proper extension
is
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > assigned to your file. You can turn on the extensions for all
files
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
by
Post by Brian Combs
| > going into the Folder Options from within Windows Explorer and
choosing
Post by Brian Combs
| > the
| > View tab and selecting to 'Show all files' and to not "Hide extensions
of
| > known file types".
| > 5. Create a dummy file out of a new text file. Rename the file to
the
Post by Brian Combs
| >
| > IEXPLORE.EXE.LOCAL
| >
| > The proper extension for this file is .local If you create
this
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
file
and
| > you still have a Notepad icon for the file, re-do step 4 above.
| > 6. Once the file has been created successfully, copy a suitable
logging
Post by Brian Combs
| > version of WININET.DLL into the same directory as the file you created
in
| > step 5.
| > 7. Once the logging version of WININET is in place, open a CMD prompt.
| > Navigate to the location of where Internet Explorer is installed.
| > Typically this is either the \Program Files\Internet Explorer
folder
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
or
Post by Brian Combs
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| >
| > SET WININETLOG=1
| >
| > 9. Now that the logging environment variable is set, you can now start
the
| >
| > IEXPLORE.EXE
| >
| > 10. Internet Explorer should now open on the desktop and navigate
to
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
the
Post by Brian Combs
| > Start Page. It is important that you do not close either the CMD
window
| > or
| > Internet Explorer. As soon as Internet Explorer starts
navigation,
a
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > WININET.LOG file will be created on the desktop. Do not attempt to
open
Post by Brian Combs
| > this log while it is being written to.
| > 11. Recreate the problem. Once the behavior is observed, you can
now
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > safely close Internet Explorer, as well as the CMD window.
Logging
should
| > cease. The log file should be zipped up and forwarded to a support
| > professional that has been trained to read these logs. If the log
is
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
too
| > large to send via Microsoft email (5mb), then it must be placed
on
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
the
| > FTPPSS FTP site (ftp://ftppss.microsoft.com)
| > 12. Very Important: once logging is complete, you should remove
the
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > logging version of WININET.DLL and the IEXPLORE.EXE.LOCAL file.
Leaving
Post by Brian Combs
| > the logging version of WININET.DLL in place can affect overall
browsing
Post by Brian Combs
| > performance because of the numerous checks written into that
version.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| >
| > TIP: For contrast purposes, it would be advisable to have a
log
of
the
| > problem occurring and one of a normal condition, if possible.
Also,
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
a
Post by Brian Combs
| > Network Monitor packet trace that is taken at the same time as the
WININET
| > log may also be beneficial when attempting to correlate network
patterns
Post by Brian Combs
| > during the WININET communication.
| >
| > NOTE: All of Microsoft's operating systems from Windows 2000 and
forward
| > support the use of IEXPLORE.EXE.LOCAL. This concept is called Dynamic
| > Link
| > Library Redirection and documented online at
http://msdn.microsoft.com.
Post by Brian Combs
| >
| > NOTE: If you are using a custome WinInet application you can
replace
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > IEXPLORE.EXE.LOCAL with your Application file name. And then
run
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
your
| > application from the command prompt.
| >
| > NOTE: You can change where the log file is saved by setting
environment
Post by Brian Combs
| > "set wininetlogfile=c:\temp\MyNewLog.log" with out the quotes.
| >
| >
| > Thanks
| > Brian [MSFT]
| > Microsoft Developer Support
| > This posting is provided "AS IS" with no warranties, and confers no
| > rights.
| > --------------------
| > | From: "Paul Baker [MVP, Windows - SDK]"
| > | Subject: Re: Controlling FtpGetFile
| > | Date: Wed, 11 Aug 2004 09:23:47 -0400
| > | Lines: 47
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| > | Newsgroups: microsoft.public.inetsdk.programming.wininet
| > | NNTP-Posting-Host: 66-192-38-14.bccsoftware.com 66.192.38.14
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.inetsdk.programming.wininet:11247
| > | X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
| > |
| > | Graham,
| > |
| > | As I said, I am able to use FtpOpenFile to download a file from
an
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
FTP
Post by Brian Combs
| > | server that does not support the SIZE command (responds with an
error
Post by Brian Combs
| > like
| > | you describe), so your premise that WinInet cannot be used to
download a
| > | file from an FTP server that does not support the SIZE command is
false.
| > | There is something more going on here.
| > |
| > | I am not sure why Brian from Microsoft would try to steer you
away
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
from
| > his
| > | company's own product, because it works for me and perhaps we
just
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
need
| > some
| > | troubleshooting. I feel like a Microsoft sales rep!
| > |
| > | Paul
| > |
| > | > Paul, thanks for your response.
| > | >
| > | > both FtpGetfile and FTPOpenFile issue a SIZE command before the
RETR.
| > | >
| > | > The ftp server returns an error when is comes accross SIZE,
uncognised
| > | > command!
| > | >
| > | > It's looking like I shall have to search out a replacement
lib
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
for
| > ftp.
| > | Does
| > | > anyone know of one - one that's free of course ;-)
| > | >
| > | > Graham
| > | >
| > | > "Paul Baker [MVP, Windows - SDK]"
| > in
| > | > > "Paul Baker [MVP, Windows - SDK]"
| > | in
| > | > > [snip]
| > | > > > Maybe I can look at the source code through the MVPSLP.
| > | > >
| > | > >
| > | > > Source code for WinInet is apparently not currently
available.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > | > >
| > | > > Paul
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|
Gravy
2004-09-03 12:13:18 UTC
Permalink
Hi Paul,

I have repro'ed the problem in a small win32 console app. I tried generating
the wininet log files but as soon as I run the test app it seems to hang and
the attached log file is generated in the current directory. BTW, I'm
running WinXP SP2.

I can confirm that the code does work on another FTP site that accepts the
SIZE command.

Thanks for your help
Post by Paul Baker [MVP, Windows - SDK]
WinInet should not be used in a service. If you choose to use it, you are in
an unsupported situation. I would guess that FTP is safer than HTTP though.
It does not have the complications of caching, cookies, user prompts and so
on all of which depend on a logged in user, which I suspect is the big
reason that it is not supported. So if you want to, you may be able to get
it to work.
WinHTTP supports only HTTP, that's right.
I guess creating an FTP.EXE process is fine.
It's up to you whether you want to take the time to figure out what the
problem with WinInet is. But it will take time. I would try taking the same
exact code, removing fluff and putting in a test program that Win32 native
EXE and NOT a service. This will eliminate the possibility of it being a
service.
Also, you could try other FTP servers, such as ones you know DO support the
SIZE command.
It's really up to you how oyu want to proceed. But we need more factual
details and troubleshooting from you.
Paul
Post by Gravy
Sorry, the comma was added by me, I just tried it again.
As for a sample program, this may be a little hard because of other time
constraints but I shall try my hardest to get it done.
One thing is confusing me though. Easlier on in the post I was advised not
to use WinINet in a service but to consider WinHttp instead. However, the
docs for WinHttp suggests that you don't use it for FTP access
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winhttp/http/porting_wininet_applications_to_winhttp.asp.
Post by Gravy
If that is the case was technology could I use?
I have been thinking about using the command line FTP.EXE. The service
could
Post by Gravy
create a command file at runtime and shell out to FTP.EXE giving it the
newly created command file. I've tried it and it works but what are
issues?
Post by Gravy
Anyone know?
Regards
Graham
Post by Paul Baker [MVP, Windows - SDK]
I don't know what kind of response would be a problem, maybe Brian does.
Maybe you should use telnet to send USER, PASS and SIZE commands to the FTP
server and send us a log of the response. Was it really "500, command
not
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
understood"? I am not sure if the comma is right.
Do you have a simple test program that uses WinInet and exhibits the
problem, and a corresponding log that Brian asked for?
Paul
Post by Gravy
Thanks for the response Paul.
Telnetting to the server on port21 would be interesting, normally
(using
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
FTP) I have to first authenticate with a proxy then send the USER
commend
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
to
Post by Gravy
log in to the ftp server, then I can send the size command. I'm sure
that
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
when I was monitoring the FTP session last time I received an error
code
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
of
Post by Gravy
500, command not understood.
What sort of response would cause GetFtpFile (or something similar) to
fail?
Post by Gravy
Graham
in
Post by Paul Baker [MVP, Windows - SDK]
Graham,
You could telnet to the server on port 21 and send the commands
manually.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
You can then tell us what the response to the SIZE command is, which
is
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
probably the most important factor here. In addition, if you want to try
getting the logs that Brian needs, I would try to isolate it to a simple
program that is not a service.
After some digging, I now understand better what is going on.
FtpOpenFile and FtpGetFile send a SIZE command apparently so that
calls
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
to
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
FtpGetFileSize can return the file size. However, I don't know why it
doesn't simply send the SIZE command when FtpGetFileSize is called
and
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
avoid
it otherwise [Problem 1!]. The FtpGetFileSize function is new to
IE5,
so
this behaviour might only be newer versions of WinInet.
The file size is not used to decide when to stop downloading the
file
(which
I am glad of).
The trouble is that if the response from the server to the SIZE
command
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
is
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
probably incorrect [Problem 2!]. However, this should not stop
FtpOpenFile
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
and FtpGetFile from succeeding [Problem 3!]. Note that if the
response
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
from
the server to the SIZE command is correct, but it just doesn't
support
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
the
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
SIZE command, it seems to work fine.
So, I believe there are 3 problems conspiring against you.
Paul
Post by Brian Combs
Hello
WinInet is not supported for use in a service.
238425 INFO: WinInet Not Supported for Use in Services
http://support.microsoft.com/?id=238425
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no
rights.
Post by Brian Combs
--------------------
| Subject: Re: Controlling FtpGetFile
| Date: Mon, 16 Aug 2004 15:40:22 +0100
| Lines: 221
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11257
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Thanks for the response you guys.
|
| Brian, near the bottom of your last email you had instructions on
how
to
| start wininet logging, there is one part of this I have a slight problem
|
| ...
| NOTE: If you are using a custome WinInet application you can
replace
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| IEXPLORE.EXE.LOCAL with your Application file name. And then run
your
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| application from the command prompt.
| ...
|
| My application that uses WinINet is a C++ service, I hope this
doesn't
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| complicate matters too much.
|
| Anyway, once I have followed the logging steps I run the service
and
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
also
Post by Brian Combs
| DebugView (from SysInternals.com) and I get the following message
in
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
my
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
|
| Wininet Assertion Failed: 0
| Source file: g:\n2\inetcore\wininet\urlcache\filemap.cxx
| Source line: 1146
| Thread: 00000be8
|
| and my server then does nothing else, appart from retry eveny 1
minute
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
or
Post by Brian Combs
| so.
|
| I'm running XP SP2 with the debug Wininet dll vernion
6.0.2800.1106.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
have
Post by Brian Combs
| you any ideas what wrong??
|
| Thanks for your help
|
| Graham
| > Hello
| > This we do know, WinInet will send the Size command for any of
the
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > following commands: FtpOpenFile, FtpGetFile, and FtpCommand with
RETR
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
as
Post by Brian Combs
| > the command.
| > So I will assume that it depends on how the FTP server response
to
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
a
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > command that it does not understand that could cause WinInet to
fail.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
You
| > can get network trace and WinInet log to see what is going on.
Also
we
| > know
| > that WinInet is limited for FTP.
| >
| > 172712 INFO: Limitations of WinInet FTP Functions
| > http://support.microsoft.com/?id=172712
| >
| > You can download debug builds of WinInet.Dll from the following
| >
ftp://ftp.microsoft.com/PSS/Tools/Developer%20Support%20Tools/WinInet/
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > You should use the build number that is closest to the version
of
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
WinInet
| > that is on your system.
| >
| > On Win ME/ Windows 2000/ Windows XP and greater OSs with Windows
File
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > Protection
| >
| > 1. Configure Internet Explorer to use a default Start Page as
close
to
the
| > page as possible. This eliminates much unnecessary logging that
will
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
add
| > additional size to the output log.
| > 2. Close Internet Explorer as well as any other Internet-based
| > applications
| > (additional applications that use WININET for connectivity may
generate
Post by Brian Combs
| > extra traffic within the log).
| > 3. Navigate to the location of where Internet Explorer is
installed.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > Typically this is either the \Program Files\Internet Explorer
folder
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
or
Post by Brian Combs
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| > 4. You must have extensions viewable so that the proper
extension
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
is
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > assigned to your file. You can turn on the extensions for all
files
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
by
Post by Brian Combs
| > going into the Folder Options from within Windows Explorer and
choosing
Post by Brian Combs
| > the
| > View tab and selecting to 'Show all files' and to not "Hide extensions
of
| > known file types".
| > 5. Create a dummy file out of a new text file. Rename the
file
to
the
Post by Brian Combs
| >
| > IEXPLORE.EXE.LOCAL
| >
| > The proper extension for this file is .local If you create
this
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
file
and
| > you still have a Notepad icon for the file, re-do step 4 above.
| > 6. Once the file has been created successfully, copy a suitable
logging
Post by Brian Combs
| > version of WININET.DLL into the same directory as the file you created
in
| > step 5.
| > 7. Once the logging version of WININET is in place, open a CMD prompt.
| > Navigate to the location of where Internet Explorer is
installed.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > Typically this is either the \Program Files\Internet Explorer
folder
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
or
Post by Brian Combs
| > the
| > \Program Files\Plus!\Microsoft Internet folder.
| >
| > SET WININETLOG=1
| >
| > 9. Now that the logging environment variable is set, you can
now
start
the
| >
| > IEXPLORE.EXE
| >
| > 10. Internet Explorer should now open on the desktop and
navigate
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
to
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
the
Post by Brian Combs
| > Start Page. It is important that you do not close either the
CMD
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
window
| > or
| > Internet Explorer. As soon as Internet Explorer starts
navigation,
a
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > WININET.LOG file will be created on the desktop. Do not
attempt
to
open
Post by Brian Combs
| > this log while it is being written to.
| > 11. Recreate the problem. Once the behavior is observed, you
can
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
now
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > safely close Internet Explorer, as well as the CMD window.
Logging
should
| > cease. The log file should be zipped up and forwarded to a support
| > professional that has been trained to read these logs. If the
log
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
is
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
too
| > large to send via Microsoft email (5mb), then it must be placed
on
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
the
| > FTPPSS FTP site (ftp://ftppss.microsoft.com)
| > 12. Very Important: once logging is complete, you should remove
the
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > logging version of WININET.DLL and the IEXPLORE.EXE.LOCAL file.
Leaving
Post by Brian Combs
| > the logging version of WININET.DLL in place can affect overall
browsing
Post by Brian Combs
| > performance because of the numerous checks written into that
version.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| >
| > TIP: For contrast purposes, it would be advisable to have a
log
of
the
| > problem occurring and one of a normal condition, if possible.
Also,
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
a
Post by Brian Combs
| > Network Monitor packet trace that is taken at the same time as
the
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
WININET
| > log may also be beneficial when attempting to correlate network
patterns
Post by Brian Combs
| > during the WININET communication.
| >
| > NOTE: All of Microsoft's operating systems from Windows 2000
and
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
forward
| > support the use of IEXPLORE.EXE.LOCAL. This concept is called Dynamic
| > Link
| > Library Redirection and documented online at
http://msdn.microsoft.com.
Post by Brian Combs
| >
| > NOTE: If you are using a custome WinInet application you can
replace
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > IEXPLORE.EXE.LOCAL with your Application file name. And then
run
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
your
| > application from the command prompt.
| >
| > NOTE: You can change where the log file is saved by setting
environment
Post by Brian Combs
| > "set wininetlogfile=c:\temp\MyNewLog.log" with out the quotes.
| >
| >
| > Thanks
| > Brian [MSFT]
| > Microsoft Developer Support
| > This posting is provided "AS IS" with no warranties, and
confers
no
| > rights.
| > --------------------
| > | From: "Paul Baker [MVP, Windows - SDK]"
| > | Subject: Re: Controlling FtpGetFile
| > | Date: Wed, 11 Aug 2004 09:23:47 -0400
| > | Lines: 47
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| > | Newsgroups: microsoft.public.inetsdk.programming.wininet
| > | NNTP-Posting-Host: 66-192-38-14.bccsoftware.com 66.192.38.14
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.inetsdk.programming.wininet:11247
| > | X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
| > |
| > | Graham,
| > |
| > | As I said, I am able to use FtpOpenFile to download a file
from
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
an
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
FTP
Post by Brian Combs
| > | server that does not support the SIZE command (responds with
an
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
error
Post by Brian Combs
| > like
| > | you describe), so your premise that WinInet cannot be used to
download a
| > | file from an FTP server that does not support the SIZE
command
is
false.
| > | There is something more going on here.
| > |
| > | I am not sure why Brian from Microsoft would try to steer you
away
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
from
| > his
| > | company's own product, because it works for me and perhaps we
just
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
need
| > some
| > | troubleshooting. I feel like a Microsoft sales rep!
| > |
| > | Paul
| > |
| > | > Paul, thanks for your response.
| > | >
| > | > both FtpGetfile and FTPOpenFile issue a SIZE command before the
RETR.
| > | >
| > | > The ftp server returns an error when is comes accross SIZE,
uncognised
| > | > command!
| > | >
| > | > It's looking like I shall have to search out a replacement
lib
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
for
| > ftp.
| > | Does
| > | > anyone know of one - one that's free of course ;-)
| > | >
| > | > Graham
| > | >
| > | > "Paul Baker [MVP, Windows - SDK]"
| > in
| > | > > "Paul Baker [MVP, Windows - SDK]"
| > | in
| > | > > [snip]
| > | > > > Maybe I can look at the source code through the MVPSLP.
| > | > >
| > | > >
| > | > > Source code for WinInet is apparently not currently
available.
Post by Gravy
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| > | > >
| > | > > Paul
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|
begin 666 WININET.LOG.ftptest.exe.3820.LOG
M#0H^/CX^(%=I;***@5F5R<VEO;B Q+C(@0G5I;&0@-BXP,"XR.# P($%U
M9R R.2 R,# R(# U.C0T.C$Y#0H^/CX^(%!R;V-E<W,@9G1P=&5S="YE>&4@
M6S,X,C @*#!X965C*5T@<W1A<G1E9"!A=" Q,SHP-#HP."XV-S0@,#DO,#,O
M,C P- T*/CX^/B!#;VUM86YD(&QI;F4@/2 B9G1P=&5S="YE>&4B#0H-"B @
M(" @26YT97)N971$96)U9T5R<F]R3&5V96P@(" @(" ]($EN9F\@6S!=#0H@
M(" @($EN=&5R;F5T1&5B=6=#;VYT<F]L1FQA9W,@(" @/2 P># P-# S9C1F
M#0H@(" @($EN=&5R;F5T1&5B=6=#871E9V]R>49L86=S(" @/2 P>&9F9F9F
M9F9F#0H@(" @($EN=&5R;F5T1&5B=6="<F5A:T9L86=S(" @(" @/2 P># P
M,# P,# P#0H@(" @($EN=&5R;F5T1&5B=6=);F1E;G1);F-R96UE;G0@/2 R
M#0H-"C$S.C T.C X+C8W." P,# P,#1F,#H\87!P/B P,#$@26YT97)N971/
M<&***@B9G1P=&5S="(L($E.5$523D547T]014Y?5%E015]04D5#3TY&24<@
M*# I+" B(BP@(B(L(#!X-# P,# P,"D-"@T**BHJ(%=I;***@07-S97)T
M:6]N(&9A:6QE9#H@, T**BHJ(%-O=7)C92!F:6QE.B!G.EQN,EQI;F5T8V]R
M95QW:6YI;F5T7'5R;&-A8VAE7&9I;&5M87 N8WAX#0HJ****@4V]U<F-E(&QI
M;F4Z(#$Q-#8-"BHJ*B!4:')E860@,# P,# T9C -"@T*#0HJ****@5VEN:6YE
M="!!<W-E<G1I;***@9F%I;&5D.B!&04Q310T**BHJ(%-O=7)C92!F:6QE.B!G
M.EQN,EQI;F5T8V]R95QW:6YI;F5T7'5R;&-A8VAE7&9I;&5M87 N8WAX#0HJ
M****@4V]U<F-E(&QI;F4Z(#$R.3(-"BHJ*B!4:')E860@,# P,# T9C -"@T*
M,3,Z,#0Z,#@N-S T(# P,# P-&8P.CQA<' ^(# P,2 @($U%34U!4%]&24Q%
2.CI);FET9F%I;&5D+" X-PT*
`
end
Brian Combs
2004-09-07 20:10:02 UTC
Permalink
Hello
You failed to get log file because you appear to be on XP sp2 and the debug
build you used does not match up with the version of WinInet that ships
with XP sp2. I have sent e-mail to see if we can get the a debug build for
XP sp2 uploaded to the FTP site.

For testing I would test with FtpJr sample from Platform SDK.

If you have XP without SP2 or Window 2000 on a box the debug build you used
should work.

Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Gravy" <***@discussions.microsoft.com>
| References: <#***@TK2MSFTNGP09.phx.gbl>
<***@cpmsftngxa06.phx.gbl>
<***@TK2MSFTNGP09.phx.gbl>
<***@TK2MSFTNGP11.phx.gbl>
<***@TK2MSFTNGP09.phx.gbl>
<***@tk2msftngp13.phx.gbl>
<***@cpmsftngxa06.phx.gbl>
<***@TK2MSFTNGP11.phx.gbl>
<***@cpmsftngxa10.phx.gbl>
<***@TK2MSFTNGP15.phx.gbl>
<#***@TK2MSFTNGP11.phx.gbl>
<e7W7K$***@TK2MSFTNGP11.phx.gbl>
<***@tk2msftngp13.phx.gbl>
<***@TK2MSFTNGP11.phx.gbl>
| Subject: Re: Controlling FtpGetFile
| Date: Fri, 3 Sep 2004 13:13:18 +0100
| Lines: 594
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <***@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl
microsoft.public.inetsdk.programming.wininet:11652
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Hi Paul,
|
| I have repro'ed the problem in a small win32 console app. I tried
generating
| the wininet log files but as soon as I run the test app it seems to hang
and
| the attached log file is generated in the current directory. BTW, I'm
| running WinXP SP2.
|
| I can confirm that the code does work on another FTP site that accepts
the
| SIZE command.
|
| Thanks for your help
|
| "Paul Baker [MVP, Windows - SDK]" <***@online.rochester.rr.com> wrote
in
| message news:***@TK2MSFTNGP11.phx.gbl...
| > WinInet should not be used in a service. If you choose to use it, you
are
| > in
| > an unsupported situation. I would guess that FTP is safer than HTTP
| > though.
| > It does not have the complications of caching, cookies, user prompts
and
| > so
| > on all of which depend on a logged in user, which I suspect is the big
| > reason that it is not supported. So if you want to, you may be able to
get
| > it to work.
| >
| > WinHTTP supports only HTTP, that's right.
| >
| > I guess creating an FTP.EXE process is fine.
| >
| > It's up to you whether you want to take the time to figure out what the
| > problem with WinInet is. But it will take time. I would try taking the
| > same
| > exact code, removing fluff and putting in a test program that Win32
native
| > EXE and NOT a service. This will eliminate the possibility of it being
a
| > service.
| >
| > Also, you could try other FTP servers, such as ones you know DO support
| > the
| > SIZE command.
| >
| > It's really up to you how oyu want to proceed. But we need more factual
| > details and troubleshooting from you.
| >
| > Paul
| >
| > "Gravy" <***@discussions.microsoft.com> wrote in message
| > news:***@tk2msftngp13.phx.gbl...
| >> Sorry, the comma was added by me, I just tried it again.
| >>
| >> As for a sample program, this may be a little hard because of other
time
| >> constraints but I shall try my hardest to get it done.
| >>
| >> One thing is confusing me though. Easlier on in the post I was advised
| >> not
| >> to use WinINet in a service but to consider WinHttp instead. However,
the
| >> docs for WinHttp suggests that you don't use it for FTP access
| >>
| >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winhttp/htt
p/porting_wininet_applications_to_winhttp.asp.
| >> If that is the case was technology could I use?
| >>
| >> I have been thinking about using the command line FTP.EXE. The service
| > could
| >> create a command file at runtime and shell out to FTP.EXE giving it the
| >> newly created command file. I've tried it and it works but what are
| > issues?
| >> Anyone know?
| >>
| >> Regards
| >>
| >> Graham
| >>
| >> "Paul Baker [MVP, Windows - SDK]" <***@online.rochester.rr.com>
wrote
| >> in
| >> message news:e7W7K$***@TK2MSFTNGP11.phx.gbl...
| >> >I don't know what kind of response would be a problem, maybe Brian
does.
| >> >
| >> > Maybe you should use telnet to send USER, PASS and SIZE commands to
the
| >> > FTP
| >> > server and send us a log of the response. Was it really "500, command
| > not
| >> > understood"? I am not sure if the comma is right.
| >> >
| >> > Do you have a simple test program that uses WinInet and exhibits the
| >> > problem, and a corresponding log that Brian asked for?
| >> >
| >> > Paul
| >> >
| >> > "Gravy" <***@discussions.microsoft.com> wrote in message
| >> > news:%***@TK2MSFTNGP11.phx.gbl...
| >> >> Thanks for the response Paul.
| >> >>
| >> >> Telnetting to the server on port21 would be interesting, normally
| > (using
| >> >> FTP) I have to first authenticate with a proxy then send the USER
| > commend
| >> > to
| >> >> log in to the ftp server, then I can send the size command. I'm sure
| > that
| >> >> when I was monitoring the FTP session last time I received an error
| > code
| >> > of
| >> >> 500, command not understood.
| >> >>
| >> >> What sort of response would cause GetFtpFile (or something similar)
to
| >> > fail?
| >> >>
| >> >> Graham
| >> >>
| >> >> "Paul Baker [MVP, Windows - SDK]" <***@online.rochester.rr.com>
| >> >> wrote
| >> >> in
| >> >> message news:***@TK2MSFTNGP15.phx.gbl...
| >> >> > Graham,
| >> >> >
| >> >> > You could telnet to the server on port 21 and send the commands
| >> > manually.
| >> >> > You can then tell us what the response to the SIZE command is,
which
| > is
| >> >> > probably the most important factor here. In addition, if you want
to
| >> >> > try
| >> >> > getting the logs that Brian needs, I would try to isolate it to a
| >> >> > simple
| >> >> > program that is not a service.
| >> >> >
| >> >> > After some digging, I now understand better what is going on.
| >> >> >
| >> >> > FtpOpenFile and FtpGetFile send a SIZE command apparently so that
| > calls
| >> > to
| >> >> > FtpGetFileSize can return the file size. However, I don't know
why
| >> >> > it
| >> >> > doesn't simply send the SIZE command when FtpGetFileSize is called
| > and
| >> >> > avoid
| >> >> > it otherwise [Problem 1!]. The FtpGetFileSize function is new to
| >> >> > IE5,
| >> >> > so
| >> >> > this behaviour might only be newer versions of WinInet.
| >> >> >
| >> >> > The file size is not used to decide when to stop downloading the
| >> >> > file
| >> >> > (which
| >> >> > I am glad of).
| >> >> >
| >> >> > The trouble is that if the response from the server to the SIZE
| > command
| >> > is
| >> >> > probably incorrect [Problem 2!]. However, this should not stop
| >> > FtpOpenFile
| >> >> > and FtpGetFile from succeeding [Problem 3!]. Note that if the
| > response
| >> >> > from
| >> >> > the server to the SIZE command is correct, but it just doesn't
| > support
| >> > the
| >> >> > SIZE command, it seems to work fine.
| >> >> >
| >> >> > So, I believe there are 3 problems conspiring against you.
| >> >> >
| >> >> > Paul
| >> >> >
| >> >> > "Brian Combs" <***@online.microsoft.com> wrote in message
| >> >> > news:***@cpmsftngxa10.phx.gbl...
| >> >> >> Hello
| >> >> >> WinInet is not supported for use in a service.
| >> >> >> 238425 INFO: WinInet Not Supported for Use in Services
| >> >> >> http://support.microsoft.com/?id=238425
| >> >> >>
| >> >> >> Thanks
| >> >> >> Brian [MSFT]
| >> >> >> Microsoft Developer Support
| >> >> >> This posting is provided "AS IS" with no warranties, and confers
no
| >> >> > rights.
| >> >> >> --------------------
| >> >> >> | From: "Gravy" <***@discussions.microsoft.com>
| >> >> >> | References: <#***@TK2MSFTNGP09.phx.gbl>
| >> >> >> <***@cpmsftngxa06.phx.gbl>
| >> >> >> <***@TK2MSFTNGP09.phx.gbl>
| >> >> >> <***@TK2MSFTNGP11.phx.gbl>
| >> >> >> <***@TK2MSFTNGP09.phx.gbl>
| >> >> >> <***@tk2msftngp13.phx.gbl>
| >> >> >> <***@cpmsftngxa06.phx.gbl>
| >> >> >> | Subject: Re: Controlling FtpGetFile
| >> >> >> | Date: Mon, 16 Aug 2004 15:40:22 +0100
| >> >> >> | Lines: 221
| >> >> >> | X-Priority: 3
| >> >> >> | X-MSMail-Priority: Normal
| >> >> >> | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| >> >> >> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| >> >> >> | X-RFC2646: Format=Flowed; Original
| >> >> >> | Message-ID: <***@TK2MSFTNGP11.phx.gbl>
| >> >> >> | Newsgroups: microsoft.public.inetsdk.programming.wininet
| >> >> >> | NNTP-Posting-Host: 114.as15758.net 62.105.115.114
| >> >> >> | Path:
| >> >> >>
| >> >> >
| >> >
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
| >> >> >> phx.gbl
| >> >> >> | Xref: cpmsftngxa06.phx.gbl
| >> >> >> microsoft.public.inetsdk.programming.wininet:11257
| >> >> >> | X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
| >> >> >> |
| >> >> >> | Thanks for the response you guys.
| >> >> >> |
| >> >> >> | Brian, near the bottom of your last email you had instructions
on
| >> >> >> how
| >> >> >> to
| >> >> >> | start wininet logging, there is one part of this I have a
slight
| >> >> >> problem
| >> >> >> | with:
| >> >> >> |
| >> >> >> | ...
| >> >> >> | NOTE: If you are using a custome WinInet application you can
| > replace
| >> >> >> | IEXPLORE.EXE.LOCAL with your Application file name. And then
run
| >> > your
| >> >> >> | application from the command prompt.
| >> >> >> | ...
| >> >> >> |
| >> >> >> | My application that uses WinINet is a C++ service, I hope this
| >> > doesn't
| >> >> >> | complicate matters too much.
| >> >> >> |
| >> >> >> | Anyway, once I have followed the logging steps I run the
service
| > and
| >> >> > also
| >> >> >> | DebugView (from SysInternals.com) and I get the following
message
| > in
| >> > my
| >> >> >> | Debug window:
| >> >> >> |
| >> >> >> | Wininet Assertion Failed: 0
| >> >> >> | Source file: g:\n2\inetcore\wininet\urlcache\filemap.cxx
| >> >> >> | Source line: 1146
| >> >> >> | Thread: 00000be8
| >> >> >> |
| >> >> >> | and my server then does nothing else, appart from retry eveny 1
| >> > minute
| >> >> > or
| >> >> >> | so.
| >> >> >> |
| >> >> >> | I'm running XP SP2 with the debug Wininet dll vernion
| > 6.0.2800.1106.
| >> >> > have
| >> >> >> | you any ideas what wrong??
| >> >> >> |
| >> >> >> | Thanks for your help
| >> >> >> |
| >> >> >> | Graham
| >> >> >> | "Brian Combs" <***@online.microsoft.com> wrote in message
| >> >> >> | news:***@cpmsftngxa06.phx.gbl...
| >> >> >> | > Hello
| >> >> >> | > This we do know, WinInet will send the Size command for any
of
| > the
| >> >> >> | > following commands: FtpOpenFile, FtpGetFile, and FtpCommand
| >> >> >> with
| >> > RETR
| >> >> > as
| >> >> >> | > the command.
| >> >> >> | > So I will assume that it depends on how the FTP server
response
| > to
| >> > a
| >> >> >> | > command that it does not understand that could cause WinInet
to
| >> > fail.
| >> >> >> You
| >> >> >> | > can get network trace and WinInet log to see what is going
on.
| >> >> >> Also
| >> >> >> we
| >> >> >> | > know
| >> >> >> | > that WinInet is limited for FTP.
| >> >> >> | >
| >> >> >> | > 172712 INFO: Limitations of WinInet FTP Functions
| >> >> >> | > http://support.microsoft.com/?id=172712
| >> >> >> | >
| >> >> >> | > You can download debug builds of WinInet.Dll from the
following
| >> >> >> location:
| >> >> >> | >
| >> >> >>
| > ftp://ftp.microsoft.com/PSS/Tools/Developer%20Support%20Tools/WinInet/
| >> >> >> | > You should use the build number that is closest to the
version
| > of
| >> >> >> WinInet
| >> >> >> | > that is on your system.
| >> >> >> | >
| >> >> >> | > On Win ME/ Windows 2000/ Windows XP and greater OSs with
| >> >> >> Windows
| >> > File
| >> >> >> | > Protection
| >> >> >> | >
| >> >> >> | > 1. Configure Internet Explorer to use a default Start Page as
| >> >> >> close
| >> >> >> to
| >> >> >> the
| >> >> >> | > page as possible. This eliminates much unnecessary logging
| >> >> >> that
| >> > will
| >> >> >> add
| >> >> >> | > additional size to the output log.
| >> >> >> | > 2. Close Internet Explorer as well as any other
Internet-based
| >> >> >> | > applications
| >> >> >> | > (additional applications that use WININET for connectivity
may
| >> >> > generate
| >> >> >> | > extra traffic within the log).
| >> >> >> | > 3. Navigate to the location of where Internet Explorer is
| >> > installed.
| >> >> >> | > Typically this is either the \Program Files\Internet Explorer
| >> > folder
| >> >> > or
| >> >> >> | > the
| >> >> >> | > \Program Files\Plus!\Microsoft Internet folder.
| >> >> >> | > 4. You must have extensions viewable so that the proper
| > extension
| >> > is
| >> >> >> | > assigned to your file. You can turn on the extensions for
all
| >> > files
| >> >> > by
| >> >> >> | > going into the Folder Options from within Windows Explorer
and
| >> >> > choosing
| >> >> >> | > the
| >> >> >> | > View tab and selecting to 'Show all files' and to not "Hide
| >> >> >> extensions
| >> >> >> of
| >> >> >> | > known file types".
| >> >> >> | > 5. Create a dummy file out of a new text file. Rename the
| >> >> >> file
| >> >> >> to
| >> >> > the
| >> >> >> | > following filename and extension:
| >> >> >> | >
| >> >> >> | > IEXPLORE.EXE.LOCAL
| >> >> >> | >
| >> >> >> | > The proper extension for this file is .local If you create
| > this
| >> >> >> file
| >> >> >> and
| >> >> >> | > you still have a Notepad icon for the file, re-do step 4
above.
| >> >> >> | > 6. Once the file has been created successfully, copy a
suitable
| >> >> > logging
| >> >> >> | > version of WININET.DLL into the same directory as the file
you
| >> >> >> created
| >> >> >> in
| >> >> >> | > step 5.
| >> >> >> | > 7. Once the logging version of WININET is in place, open a
CMD
| >> >> >> prompt.
| >> >> >> | > Navigate to the location of where Internet Explorer is
| > installed.
| >> >> >> | > Typically this is either the \Program Files\Internet Explorer
| >> > folder
| >> >> > or
| >> >> >> | > the
| >> >> >> | > \Program Files\Plus!\Microsoft Internet folder.
| >> >> >> | > 8. At the CMD prompt, type the following and hit <enter>:
| >> >> >> | >
| >> >> >> | > SET WININETLOG=1
| >> >> >> | >
| >> >> >> | > 9. Now that the logging environment variable is set, you can
| >> >> >> now
| >> >> >> start
| >> >> >> the
| >> >> >> | > logging by typing the following and hitting <enter>:
| >> >> >> | >
| >> >> >> | > IEXPLORE.EXE
| >> >> >> | >
| >> >> >> | > 10. Internet Explorer should now open on the desktop and
| > navigate
| >> > to
| >> >> > the
| >> >> >> | > Start Page. It is important that you do not close either the
| > CMD
| >> >> >> window
| >> >> >> | > or
| >> >> >> | > Internet Explorer. As soon as Internet Explorer starts
| >> >> >> navigation,
| >> > a
| >> >> >> | > WININET.LOG file will be created on the desktop. Do not
| >> >> >> attempt
| >> >> >> to
| >> >> > open
| >> >> >> | > this log while it is being written to.
| >> >> >> | > 11. Recreate the problem. Once the behavior is observed, you
| > can
| >> > now
| >> >> >> | > safely close Internet Explorer, as well as the CMD window.
| >> >> >> Logging
| >> >> >> should
| >> >> >> | > cease. The log file should be zipped up and forwarded to a
| >> >> >> support
| >> >> >> | > professional that has been trained to read these logs. If
the
| > log
| >> > is
| >> >> >> too
| >> >> >> | > large to send via Microsoft email (5mb), then it must be
placed
| > on
| >> >> >> the
| >> >> >> | > FTPPSS FTP site (ftp://ftppss.microsoft.com)
| >> >> >> | > 12. Very Important: once logging is complete, you should
| >> >> >> remove
| >> > the
| >> >> >> | > logging version of WININET.DLL and the IEXPLORE.EXE.LOCAL
file.
| >> >> > Leaving
| >> >> >> | > the logging version of WININET.DLL in place can affect
overall
| >> >> > browsing
| >> >> >> | > performance because of the numerous checks written into that
| >> > version.
| >> >> >> | >
| >> >> >> | > TIP: For contrast purposes, it would be advisable to
have a
| >> >> >> log
| >> >> >> of
| >> >> >> the
| >> >> >> | > problem occurring and one of a normal condition, if possible.
| >> > Also,
| >> >> > a
| >> >> >> | > Network Monitor packet trace that is taken at the same time
as
| > the
| >> >> >> WININET
| >> >> >> | > log may also be beneficial when attempting to correlate
network
| >> >> > patterns
| >> >> >> | > during the WININET communication.
| >> >> >> | >
| >> >> >> | > NOTE: All of Microsoft's operating systems from Windows 2000
| > and
| >> >> >> forward
| >> >> >> | > support the use of IEXPLORE.EXE.LOCAL. This concept is
called
| >> >> >> Dynamic
| >> >> >> | > Link
| >> >> >> | > Library Redirection and documented online at
| >> >> > http://msdn.microsoft.com.
| >> >> >> | >
| >> >> >> | > NOTE: If you are using a custome WinInet application you can
| >> > replace
| >> >> >> | > IEXPLORE.EXE.LOCAL with your Application file name. And then
| > run
| >> >> >> your
| >> >> >> | > application from the command prompt.
| >> >> >> | >
| >> >> >> | > NOTE: You can change where the log file is saved by setting
| >> >> > environment
| >> >> >> | > variable WininetLogFile, like this:
| >> >> >> | > "set wininetlogfile=c:\temp\MyNewLog.log" with out the
quotes.
| >> >> >> | >
| >> >> >> | >
| >> >> >> | > Thanks
| >> >> >> | > Brian [MSFT]
| >> >> >> | > Microsoft Developer Support
| >> >> >> | > This posting is provided "AS IS" with no warranties, and
| >> >> >> confers
| >> >> >> no
| >> >> >> | > rights.
| >> >> >> | > --------------------
| >> >> >> | > | From: "Paul Baker [MVP, Windows - SDK]"
| >> >> >> <***@online.rochester.rr.com>
| >> >> >> | > | References: <#***@TK2MSFTNGP09.phx.gbl>
| >> >> >> | > <***@cpmsftngxa06.phx.gbl>
| >> >> >> | > <***@TK2MSFTNGP09.phx.gbl>
| >> >> >> | > <***@TK2MSFTNGP11.phx.gbl>
| >> >> >> | > <***@TK2MSFTNGP09.phx.gbl>
| >> >> >> | > | Subject: Re: Controlling FtpGetFile
| >> >> >> | > | Date: Wed, 11 Aug 2004 09:23:47 -0400
| >> >> >> | > | Lines: 47
| >> >> >> | > | X-Priority: 3
| >> >> >> | > | X-MSMail-Priority: Normal
| >> >> >> | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| >> >> >> | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| >> >> >> | > | Message-ID: <***@tk2msftngp13.phx.gbl>
| >> >> >> | > | Newsgroups: microsoft.public.inetsdk.programming.wininet
| >> >> >> | > | NNTP-Posting-Host: 66-192-38-14.bccsoftware.com
66.192.38.14
| >> >> >> | > | Path:
| >> >> >> | >
| >> >> >>
| >> >> >
| >> >
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
| >> >> >> | > phx.gbl
| >> >> >> | > | Xref: cpmsftngxa06.phx.gbl
| >> >> >> | > microsoft.public.inetsdk.programming.wininet:11247
| >> >> >> | > | X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
| >> >> >> | > |
| >> >> >> | > | Graham,
| >> >> >> | > |
| >> >> >> | > | As I said, I am able to use FtpOpenFile to download a file
| > from
| >> > an
| >> >> > FTP
| >> >> >> | > | server that does not support the SIZE command (responds
with
| > an
| >> >> > error
| >> >> >> | > like
| >> >> >> | > | you describe), so your premise that WinInet cannot be used
to
| >> >> >> download a
| >> >> >> | > | file from an FTP server that does not support the SIZE
| >> >> >> command
| >> >> >> is
| >> >> >> false.
| >> >> >> | > | There is something more going on here.
| >> >> >> | > |
| >> >> >> | > | I am not sure why Brian from Microsoft would try to steer
you
| >> > away
| >> >> >> from
| >> >> >> | > his
| >> >> >> | > | company's own product, because it works for me and perhaps
we
| >> > just
| >> >> >> need
| >> >> >> | > some
| >> >> >> | > | troubleshooting. I feel like a Microsoft sales rep!
| >> >> >> | > |
| >> >> >> | > | Paul
| >> >> >> | > |
| >> >> >> | > | "Gravy" <***@discussions.microsoft.com> wrote in message
| >> >> >> | > | news:***@TK2MSFTNGP09.phx.gbl...
| >> >> >> | > | > Paul, thanks for your response.
| >> >> >> | > | >
| >> >> >> | > | > both FtpGetfile and FTPOpenFile issue a SIZE command
before
| >> >> >> the
| >> >> >> RETR.
| >> >> >> | > | >
| >> >> >> | > | > The ftp server returns an error when is comes accross
SIZE,
| >> >> >> uncognised
| >> >> >> | > | > command!
| >> >> >> | > | >
| >> >> >> | > | > It's looking like I shall have to search out a
replacement
| > lib
| >> >> >> for
| >> >> >> | > ftp.
| >> >> >> | > | Does
| >> >> >> | > | > anyone know of one - one that's free of course ;-)
| >> >> >> | > | >
| >> >> >> | > | > Graham
| >> >> >> | > | >
| >> >> >> | > | > "Paul Baker [MVP, Windows - SDK]"
| >> > <***@online.rochester.rr.com>
| >> >> >> | > wrote
| >> >> >> | > in
| >> >> >> | > | > message news:***@TK2MSFTNGP11.phx.gbl...
| >> >> >> | > | > > "Paul Baker [MVP, Windows - SDK]"
| >> >> > <***@online.rochester.rr.com>
| >> >> >> | > wrote
| >> >> >> | > | in
| >> >> >> | > | > > message news:***@TK2MSFTNGP09.phx.gbl...
| >> >> >> | > | > > [snip]
| >> >> >> | > | > > > Maybe I can look at the source code through the
MVPSLP.
| >> >> >> | > | > >
| >> >> >> | > | > >
| >> >> >> | > | > > Source code for WinInet is apparently not currently
| >> > available.
| >> >> >> | > | > >
| >> >> >> | > | > > Paul
| >> >> >> | > | > >
| >> >> >> | > | > >
| >> >> >> | > | >
| >> >> >> | > | >
| >> >> >> | > |
| >> >> >> | > |
| >> >> >> | > |
| >> >> >> | >
| >> >> >> |
| >> >> >> |
| >> >> >> |
| >> >> >>
| >> >> >
| >> >> >
| >> >>
| >> >>
| >> >
| >> >
| >>
| >>
| >
| >
|
|
|

Paul Baker [MVP, Windows - SDK]
2004-08-10 16:17:49 UTC
Permalink
Also, I tested this with an FTP server that exhibits these issues:

1. It does not support the SIZE command and the response is "550 Operation
is not supported under CONNECT:Mailbox FTP server."
2. The response to the LIST command cannot be parsed correctly by WinInet.
FtpFindFirstFile puts the whole item in the file name.

Therefore, WinInet does not have any way of correctly determining the file
size.

Nevertheless, FtpOpenFile and InternetReadFile can successfully download a
file from this FTP server. Therefore, with respect, what Brian is saying is
not the complete story, and I believe you may be able to get WinInet to do
what you want.

Paul

I am successfully able to use FtpOpenFie and InternetReadFile to download a
file from an FTP server that does not support the SIZE command and the
response to the LIST command .
The response to the size command is: "550 Operation is not supported under
CONNECT:Mailbox FTP server."
Post by Paul Baker [MVP, Windows - SDK]
Graham,
What does the FTP server in question do with the SIZE command? Does it
return 0 or does it return an error?
Brian,
Are you sure?
Can't you just call FtpOpenFile and InternetReadFile until it is done, ie.
the connection is closed? If it does send a SIZE command, what does it use
it for? I didn't think that had anything to do with when InternetReadFile
is
Post by Paul Baker [MVP, Windows - SDK]
done.
If you call FtpFindFirstFile, I believe it sends a LIST command and parses
the results (if it can, which is only guaranteed to work with DOS, Windows
and UNIX servers).
You can call FtpGetFileSize in IE5. I don't know if that sends a LIST
command or SIZE command.
I was not aware that any other WinInet function ever sent a SIZE command.
Maybe I can look at the source code through the MVPSLP.
Paul
Post by Brian Combs
Hello
This behavior is by design and there is no way you can change it. You
may
Post by Brian Combs
want to look at 3rd party FTP libs.
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no
rights.
Post by Brian Combs
--------------------
| Subject: Controlling FtpGetFile
| Date: Sun, 8 Aug 2004 09:02:35 +0100
| Lines: 15
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 114.as15758.net 62.105.115.114
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11237
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Hi,
|
| Is there any way in stopping FTPGetFile from issuing a SIZE command on
the
Post by Brian Combs
| remote server? I have come across an FTP site that does not understand
the
Post by Brian Combs
| SIZE command and as a result I cannot download any files from it.
| FTPCommand(...,'RETR',...), FTPGetFile and FTPOpenFile all issue a
SIZE
Post by Paul Baker [MVP, Windows - SDK]
Post by Brian Combs
| command before RETR. How can I stop this?
|
| If its not possible to stop does anyone know of a different way of
| downloading from an FTP site?
|
| Thanks for your help
| Graham
|
|
|
Loading...