Discussion:
Why does FtpGetFile sometime put a file in "Temporary Internet Files\Content.IE"?
(too old to reply)
a***@ingr.com
2007-03-06 22:30:05 UTC
Permalink
For some years, we have been running at many sites a service written
in VB.NET that calls a DLL written in Microsoft Visual Basic 6. This
DLL uses wininet.dll's FtpGetFile to copy files from an FTP directory
to a local scratch directory.

We have noticed that on some machines, FtpGetFile places a copy of the
file being copied not only into the scratch directory but also into "C:
\Documents and Settings\Default User\Local Settings\Temporary Internet
Files\Content.IE5". However, on other machines, FtpGetFile does not
place a copy of the file into "Content.IE5".

Does anyone know why this would happen on one machine but not on
another with the same DLL?

Does anyone have a suggestion on how to prevent the copying of files
by FtpGetFile into "C:\Documents and Settings\Default User\Local
Settings\Temporary Internet Files\Content.IE5"? We are looking for
machine settings or code parameters or -- preferably -- both.

--- Alan Barksdale --- ***@INGR.Com ---
mayayana
2007-03-07 01:09:19 UTC
Permalink
That call has a no-cache option in the flags
parameter, if you have access to the code.

If not then maybe it's an IE cache setting.
FTPGetFile is one of those hokey calls that's
really working through IE rather than the API.
Post by a***@ingr.com
For some years, we have been running at many sites a service written
in VB.NET that calls a DLL written in Microsoft Visual Basic 6. This
DLL uses wininet.dll's FtpGetFile to copy files from an FTP directory
to a local scratch directory.
We have noticed that on some machines, FtpGetFile places a copy of the
\Documents and Settings\Default User\Local Settings\Temporary Internet
Files\Content.IE5". However, on other machines, FtpGetFile does not
place a copy of the file into "Content.IE5".
Does anyone know why this would happen on one machine but not on
another with the same DLL?
Does anyone have a suggestion on how to prevent the copying of files
by FtpGetFile into "C:\Documents and Settings\Default User\Local
Settings\Temporary Internet Files\Content.IE5"? We are looking for
machine settings or code parameters or -- preferably -- both.
Paul Baker [MVP, Windows - Networking]
2007-03-07 17:39:53 UTC
Permalink
Here is the FtpGetFile documentation:
http://msdn2.microsoft.com/en-us/library/aa452218.aspx

It will use the same caching options that Internet Explorer does,
configurable through the Internet Options dialog. If you don't want it to
write to the cache, you can override this using the
INTERNET_FLAG_NO_CACHE_WRITE flag.

It's not really working through Internet Explorer. Internet Explorer uses
WinInet and WinInet is designed to meet the needs of Internet Explorer. So
you will see Internet Explorer-like behaviour from WinInet.

This relationship with Internet Explorer is the reason that it is oriented
towards an interactive client and why it is not intended for use in a
service. You should expect problems like this if you use it in a service:
http://support.microsoft.com/kb/238425/en-us

Having said that, Windows itself offers an service oriented alternative for
HTTP (WinHTTP) but not FTP.

Paul
Post by mayayana
That call has a no-cache option in the flags
parameter, if you have access to the code.
If not then maybe it's an IE cache setting.
FTPGetFile is one of those hokey calls that's
really working through IE rather than the API.
Post by a***@ingr.com
For some years, we have been running at many sites a service written
in VB.NET that calls a DLL written in Microsoft Visual Basic 6. This
DLL uses wininet.dll's FtpGetFile to copy files from an FTP directory
to a local scratch directory.
We have noticed that on some machines, FtpGetFile places a copy of the
\Documents and Settings\Default User\Local Settings\Temporary Internet
Files\Content.IE5". However, on other machines, FtpGetFile does not
place a copy of the file into "Content.IE5".
Does anyone know why this would happen on one machine but not on
another with the same DLL?
Does anyone have a suggestion on how to prevent the copying of files
by FtpGetFile into "C:\Documents and Settings\Default User\Local
Settings\Temporary Internet Files\Content.IE5"? We are looking for
machine settings or code parameters or -- preferably -- both.
a***@ingr.com
2007-03-07 22:26:28 UTC
Permalink
On Mar 7, 11:39 am, "Paul Baker [MVP, Windows - Networking]"
Here is theFtpGetFiledocumentation:http://msdn2.microsoft.com/en-us/library/aa452218.aspx
It will use the same caching options that Internet Explorer does,
configurable through the Internet Options dialog. If you don't want it to
write to the cache, you can override this using the
INTERNET_FLAG_NO_CACHE_WRITE flag.
It's not really working through Internet Explorer. Internet Explorer uses
WinInet and WinInet is designed to meet the needs of Internet Explorer. So
you will see Internet Explorer-like behaviour from WinInet.
This relationship with Internet Explorer is the reason that it is oriented
towards an interactive client and why it is not intended for use in a
service. You should expect problems like this if you use it in a service:http://support.microsoft.com/kb/238425/en-us
Having said that, Windows itself offers an service oriented alternative for
HTTP (WinHTTP) but not FTP.
Paul
Post by mayayana
That call has a no-cache option in the flags
parameter, if you have access to the code.
If not then maybe it's an IE cache setting.
FTPGetFileis one of those hokey calls that's
really working through IE rather than the API.
Post by a***@ingr.com
For some years, we have been running at many sites a service written
in VB.NET that calls a DLL written in Microsoft Visual Basic 6. This
DLL uses wininet.dll'sFtpGetFileto copy files from an FTP directory
to a local scratch directory.
We have noticed that on some machines,FtpGetFileplaces a copy of the
\Documents and Settings\Default User\Local Settings\Temporary Internet
Files\Content.IE5". However, on other machines,FtpGetFiledoes not
place a copy of the file into "Content.IE5".
Does anyone know why this would happen on one machine but not on
another with the same DLL?
Does anyone have a suggestion on how to prevent the copying of files
by FtpGetFile into "C:\Documents and Settings\Default User\Local
Settings\Temporary Internet Files\Content.IE5"? We are looking for
machine settings or code parameters or -- preferably -- both.
- Show quoted text -
Thanks to mayayana and Paul Baker.

We still don't know why we see the caching behavior on some machines
but not on others, but INTERNET_FLAG_NO_CACHE_WRITE made FtpGetFile
stop placing files into "C:\Documents and Settings\Default User\Local
Settings\Temporary Internet Files\Content.IE5" on all machines:

' Constant values from <http://www.devdaily.com/scw/c/cygwin/src/
winsup/w32api/include/wininet.h.shtml>. (I wish that the values in
addition to the names of the constants were easily accessible in
MSDN.)
Public Const INTERNET_FLAG_NO_CACHE_WRITE = &H4000000
Public Const FTP_TRANSFER_TYPE_BINARY = &H2

lblnReturn = FtpGetFile(mhndFTPConnection, pstrFromFilename,
pstrToFilename, False, 0, INTERNET_FLAG_NO_CACHE_WRITE +
FTP_TRANSFER_TYPE_BINARY, 0)

--- Alan F. Barksdale ---
Scherbina Vladimir
2007-03-08 11:54:52 UTC
Permalink
<***@ingr.com> wrote in message news:***@t69g2000cwt.googlegroups.com...

[...]
Post by a***@ingr.com
We still don't know why we see the caching behavior on some machines
but not on others, but INTERNET_FLAG_NO_CACHE_WRITE made FtpGetFile
stop placing files into "C:\Documents and Settings\Default User\Local
Because IE settings are different in different machines. That is, if you
_do_ specify INTERNET_FLAG_NO_CACHE_WRITE flag, the IE caching settings are
avoided and no caching is used.

--Vladimir, Windows SDK MVP

Loading...