SetCachingMethod Method
Class: FTP_SERVICE
Description:Changes the current file caching method
Changes the current file caching method.
=
Object.SetCachingMethod
Parameter
nCachingType
Cache type for internet connection.
Type Numeric
Direction Input
Can be on of the following
ValueDescription
INTERNET_FLAG_DONT_CACHEDoes not add the returned entity to the cache. This is identical to the preferred value, INTERNET_FLAG_NO_CACHE_WRITE.
INTERNET_FLAG_HYPERLINKForces a reload if there was no Expires time and no LastModified time returned from the server when determining whether to reload the item from the network.
INTERNET_FLAG_MAKE_PERSISTENTNo longer supported.
INTERNET_FLAG_MUST_CACHE_REQUESTIdentical to the preferred value, INTERNET_FLAG_NEED_FILE. Causes a temporary file to be created if the file cannot be cached.
INTERNET_FLAG_RELOADForces a download of the requested file, object, or directory listing from the origin server, not from the cache.
INTERNET_FLAG_NO_CACHE_WRITEDoes not add the returned entity to the cache.
INTERNET_FLAG_RESYNCHRONIZEReloads HTTP resources if the resource has been modified since the last time it was downloaded. All FTP and Gopher resources are reloaded.
Assumed from MSDN.
Return value Boolean
The return value is .T. if nCachingType is knowly.
Example
#INCLUDE "ftp.h" LOCAL loFTP SET PROCEDURE TO ftp.prg ADDITIVE loFTP=CREATEOBJECT('ftp_service') IF loFTP.SetCachingMethod(INTERNET_FLAG_DONT_CACHE) ?loFTP.GetCachingMethod() ENDIF RELEASE PROCEDURE ftp.prg
See also
Expand/Collapse source code of procedure SetCachingMethod Source Code
      LPARAMETERS INP nCachingType
    
      * only change caching type if we have a valid new cache type
      IF m.nCachingType = INTERNET_FLAG_DONT_CACHE OR ;
         m.nCachingType = INTERNET_FLAG_HYPERLINK OR ;
         m.nCachingType = INTERNET_FLAG_MUST_CACHE_REQUEST OR ;
         m.nCachingType = INTERNET_FLAG_NEED_FILE OR ;
         m.nCachingType = INTERNET_FLAG_NO_CACHE_WRITE OR ;
         m.nCachingType = INTERNET_FLAG_OFFLINE OR ;
         m.nCachingType = INTERNET_FLAG_RELOAD OR ;
         m.nCachingType = INTERNET_FLAG_RESYNCHRONIZE
              
         This.nCachingType = BITOR(This.nCachingType,m.nCachingType)
         RETURN .T.
      ENDIF

      RETURN .F.