INTERNET_FLAG_RELOAD 
Author Message
 INTERNET_FLAG_RELOAD

IS THERE A BUG WITH THIS????  (INTERNET_FLAG_RELOAD) OR
(FtpGetFile)

Here is my original question:

I hope you can help.........
Using VB6. 1 client software, 1 server software.

I'm sending a query to a server, the server processes the
query, and sets up the answer.   When the client receives
the answer to the query, the first answer always comes
back.  So if I close the software and try again, it will
be the new first answer.  My client software sends
approximately 15 queries to the server and I cannot have
the same answer all the time..  Why is the same answer
always coming back?  
Here is some of my code:  (please see below for more
details)

Public Const INTERNET_FLAG_RELOAD = &H80000000

Public Declare Function FtpGetFile Lib "wininet.dll" _
Alias "FtpGetFileA" (ByVal hFtpSession As Long, ByVal _
lpszRemoteFile As String, ByVal lpszNewFile As String, _
ByVal fFailIfExists As Boolean, ByVal _
dwFlagsAndAttributes As Long, ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean

Public Declare Function FtpSetCurrentDirectory _
Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA" _
    (ByVal hFtpSession As Long, ByVal lpszDirectory As _
String) As Boolean

Public Const FTP_TRANSFER_TYPE_BINARY = &H2

Public Sub GetFiles()
    Dim bRet As Boolean
    Dim szFileRemote As String, szDirRemote As String, _
szFileLocal As String
    Dim szTempString As String
    Dim sPathFromRoot As String
    Dim dwType As Long
    dwType = FTP_TRANSFER_TYPE_BINARY
    If bActiveSession Then
        szTempString = "answer.txt"
        szFileRemote = "answer.txt"
        szDirRemote = "199.243.85.26/"
        sPathFromRoot = "/programs/"
        szFileLocal = App.Path
        bRet = FtpSetCurrentDirectory(hConnection, _
sPathFromRoot)
        If bRet = False Then ErrorMeOut _
Err.LastDllError, "rcd"
        bRet = FtpGetFile(hConnection, szFileRemote, _
szFileLocal & "\" & szFileRemote, False, _
        INTERNET_FLAG_RELOAD, dwType, 0)
End If
End Sub

The problem happens when I do FtpGetFile, the bRet=True,
which is perfect and I know that the server has the
correct answer.txt file, when the client receives the
answer however, it is not the same file which is on the
server, the client receives the first answer.txt file from
the software, no matter what.  It's like there is a cache
of the file answer.txt somewhere, but I can't find it..  
INTERNET_FLAG_RELOAD is supposed to download from the
server anyway, not from the cache.

PLEASE, IF YOU NEED MORE DETAILS OR IF YOU THINK YOU CAN
HELP, IT WOULD BE APPRECIATED, YOU CAN WRITE TO ME

Thanks



Sat, 11 Sep 2004 03:30:25 GMT  
 INTERNET_FLAG_RELOAD
Mathieu,

You are correct that the file you are getting is from a cache.  In order to
resolve this you will want to move INTERNET_FLAG_RELOAD from the 5th
parameter to the 6th parameter of FtpGetFile.  Check out the following KB
article for some more information about this:
Q157607 - DOCERR: FtpGetFile & FtpOpenFile Flags Documented Incorrectly

To find a KB article you can type "MSKB articlenum" into Internet
Explorer's Address Bar (without the quotes) or you can go to
http://support.microsoft.com.

Kevin Williamson - Microsoft Visual Basic Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.

--------------------
| Content-Class: urn:content-classes:message


| Subject: INTERNET_FLAG_RELOAD
| Date: Mon, 25 Mar 2002 11:30:25 -0800
| Lines: 74

| MIME-Version: 1.0
| Content-Type: text/plain;
|       charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
| Thread-Index: AcHUM4NrWr9EyVMXSOKtHqKcFvE64A==
| Newsgroups: microsoft.public.vb.bugs
| NNTP-Posting-Host: TKMSFTNGXA14 10.201.226.42
| Path: cpmsftngxa08!cpmsftngxa09!cpmsftngxa07
| Xref: cpmsftngxa08 microsoft.public.vb.bugs:48265
| X-Tomcat-NG: microsoft.public.vb.bugs
|
| IS THERE A BUG WITH THIS????  (INTERNET_FLAG_RELOAD) OR
| (FtpGetFile)
|
| Here is my original question:
|
| I hope you can help.........
| Using VB6. 1 client software, 1 server software.
|
| I'm sending a query to a server, the server processes the
| query, and sets up the answer.   When the client receives
| the answer to the query, the first answer always comes
| back.  So if I close the software and try again, it will
| be the new first answer.  My client software sends
| approximately 15 queries to the server and I cannot have
| the same answer all the time..  Why is the same answer
| always coming back?  
| Here is some of my code:  (please see below for more
| details)
|
| Public Const INTERNET_FLAG_RELOAD = &H80000000
|
| Public Declare Function FtpGetFile Lib "wininet.dll" _
| Alias "FtpGetFileA" (ByVal hFtpSession As Long, ByVal _
| lpszRemoteFile As String, ByVal lpszNewFile As String, _
| ByVal fFailIfExists As Boolean, ByVal _
| dwFlagsAndAttributes As Long, ByVal dwFlags As Long, _
| ByVal dwContext As Long) As Boolean
|
| Public Declare Function FtpSetCurrentDirectory _
| Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA" _
|     (ByVal hFtpSession As Long, ByVal lpszDirectory As _
| String) As Boolean
|
| Public Const FTP_TRANSFER_TYPE_BINARY = &H2
|
| Public Sub GetFiles()
|     Dim bRet As Boolean
|     Dim szFileRemote As String, szDirRemote As String, _
| szFileLocal As String
|     Dim szTempString As String
|     Dim sPathFromRoot As String
|     Dim dwType As Long
|     dwType = FTP_TRANSFER_TYPE_BINARY
|     If bActiveSession Then
|         szTempString = "answer.txt"
|         szFileRemote = "answer.txt"
|         szDirRemote = "199.243.85.26/"
|         sPathFromRoot = "/programs/"
|         szFileLocal = App.Path
|         bRet = FtpSetCurrentDirectory(hConnection, _
| sPathFromRoot)
|         If bRet = False Then ErrorMeOut _
| Err.LastDllError, "rcd"
|         bRet = FtpGetFile(hConnection, szFileRemote, _
| szFileLocal & "\" & szFileRemote, False, _
|         INTERNET_FLAG_RELOAD, dwType, 0)
| End If
| End Sub
|
| The problem happens when I do FtpGetFile, the bRet=True,
| which is perfect and I know that the server has the
| correct answer.txt file, when the client receives the
| answer however, it is not the same file which is on the
| server, the client receives the first answer.txt file from
| the software, no matter what.  It's like there is a cache
| of the file answer.txt somewhere, but I can't find it..  
| INTERNET_FLAG_RELOAD is supposed to download from the
| server anyway, not from the cache.
|
| PLEASE, IF YOU NEED MORE DETAILS OR IF YOU THINK YOU CAN
| HELP, IT WOULD BE APPRECIATED, YOU CAN WRITE TO ME

|
| Thanks
|



Sat, 11 Sep 2004 23:25:41 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB6: GetFtpFile and INTERNET_FLAG_RELOAD

2. VB6: GetFtpFile and INTERNET_FLAG_RELOAD

 

 
Powered by phpBB® Forum Software