Module InetTransfer.pkg
1//*************************************************************************
2//*
3//* Copyright (c) 2000 Data Access Corporation, Miami Florida,
4//* All rights reserved.
5//* DataFlex is a registered trademark of Data Access Corporation.
6//*
7//*************************************************************************
8//*
9//* Module Name:
10//* InetTransfer.plg
11//*
12//* Creator:
13//* Sonny Falk
14//*
15//*
16//* Purpose:
17//* VDF internet transfer class definitions.
18//*
19//*************************************************************************
20// This should be USEd by Winbase.pkg or DfBase.pkg
21// Note that the class and message replacements are in DFmsg.pkg
22
23// constants for the RemotePort property...
24Define rpFtp for 21
25Define rpHttp for 80
26Define rpHttpSSL for 443 // Usual SSL port, must also set peTransferFlag to ifSecure
27
28// constants for the TransferType property...
29Define ttAscii for 1
30Define ttBinary for 2
31
32Register_Function psUsername Returns String
33Register_Procedure Set psUsername String sUser
34Register_Function psPassword Returns String
35Register_Procedure Set psPassword String sPassword
36Register_Function psRemoteHost Returns String
37Register_Procedure Set psRemoteHost String sHost
38Register_Function psAgent Returns String
39Register_Procedure Set psAgent String sAgent
40Register_Function psProxy Returns String
41Register_Procedure Set psProxy String sProxyServer
42Register_Function piRemotePort Returns Integer
43Register_Procedure Set piRemotePort Integer iPort
44Register_Function peTransferFlags Returns Integer
45Register_Procedure Set peTransferFlags Integer dwFlags
46Register_Function piBufferSize Returns Integer
47Register_Procedure Set piBufferSize Integer iSize
48Register_Function RootHandle Returns Integer
49Register_Function LastErrorCode Returns Integer
50
51Register_Function peTransferType Returns Integer
52Register_Procedure Set peTransferType Integer iType
53Register_Function pbPassiveMode Returns Integer
54Register_Procedure Set pbPassiveMode Integer bPassiveMode
55Register_Function ConnectionHandle Returns Integer
56
57Register_Function Connect Returns Integer
58Register_Function Disconnect Returns Integer
59Register_Function CurrentDirectory Returns String
60Register_Function ChangeDirectory String sPath Returns Integer
61Register_Function UploadFile String sLocalFile String sRemoteFile Returns Integer
62Register_Function DownloadFile String sRemoteFile String sLocalFile Returns Integer
63Register_Function FileSize String sFilename Returns Integer
64Register_Function FileAttributes String sFilename Returns Integer
65Register_Function CreateFtpDirectory String sDir Returns Integer
66Register_Function RemoveFtpDirectory String sDir Returns Integer
67Register_Function RenameFtpFile String sExistingName String sNewName Returns Integer
68Register_Function DeleteFtpFile String sFile Returns Integer
69Register_Function FindFirstFtpFile String sSearchStr Returns String
70Register_Function FindNextFtpFile Returns String
71Register_Procedure EndFtpFileFind
72Register_Function FtpFileExist String sFilename Returns Integer
73Register_Procedure DirectoryList String sPattern
74Register_Procedure CancelTransfer
75
76Register_Procedure OnTransferStatus Integer iBytesTransferred Integer iFileSize
77Register_Procedure OnDirectoryList String sFilename Integer iSize Integer iFileAttr
78
79Register_Procedure Set psAcceptTypes String sTypes
80Register_Function psAcceptTypes Returns String
81Register_Function psProtocolVersion Returns String
82Register_Procedure Set psProtocolVersion String sProtocol
83Register_Function psSaveAsFile Returns String
84Register_Procedure Set psSaveAsFile String sFilename
85
86Register_Function AddHeader String sHeader String sValue Returns integer
87Register_Procedure ClearHeaders
88Register_Function HttpGetRequest String sFilePath Returns Integer
89Register_Function HttpPostAddrRequest String sFilePath Address aData Integer iDataLen Integer bDataIsFile Returns Integer
90Register_Function HttpPutAddrRequest String sFilePath Address aData Integer iDataLen Integer bDataIsFile Returns Integer
91Register_Procedure OnDataReceived String sContentType String sData
92Register_Function SelectClientCertificate string sCertificateStore String sCertificateSubject returns boolean
93Register_Procedure Set pbShowErrorDialog Boolean bShow
94Register_Function pbShowErrorDialog returns Boolean
95
96
97Define ifReload for |CI$80000000 // retrieve the original item
98Define ifNoCacheWrite for |CI$04000000 // don't write this item to the cache
99Define ifMakePersistent for |CI$02000000 // make this item persistent in cache
100Define ifFromCache for |CI$01000000 // use offline semantics
101Define ifSecure for |CI$00800000 // use PCT/SSL if applicable (HTTP)
102Define ifKeepConnection for |CI$00400000 // use keep-alive semantics
103Define ifNoAutoRedirect for |CI$00200000 // don't handle redirections automatically
104Define ifReadPrefetch for |CI$00100000 // do background read prefetch
105Define ifNoCookies for |CI$00080000 // no automatic cookie handling
106Define ifNoAuth for |CI$00040000 // no automatic authentication handling
107Define ifCacheIfNetFail for |CI$00010000 // return cache file if net request fails
108Define ifIgnoreRedirectToHttp for |CI$00008000 // ex: https:// to http://
109Define IfIgnoreRedirectToHttps for |CI$00004000 // ex: http:// to https://
110Define IfIgnoreCertDateInvalid for |CI$00002000 // expired X509 Cert.
111Define IfIgnoreCertCnInvalid for |CI$00001000 // bad common name in X509 Cert.
112Define ifResynchronize for |CI$00000800 // asking wininet to update an item if it is newer
113Define ifHyperlink for |CI$00000400 // asking wininet to do hyperlinking semantic which works right for scripts
114Define ifNoUi for |CI$00000200 // no cookie popup
115Define ifPragmaNocache for |CI$00000100 // asking wininet to add "pragma: no-cache"
116Define ifCacheAsync for |CI$00000080 // ok to perform lazy cache-write
117Define ifFormsSubmit for |CI$00000040 // this is a forms submit
118Define ifNeedFile for |CI$00000010 // need a file for this request
119
120// The file or directory is an archive file or directory.
121// Applications use this attribute to mark files for backup or removal.
122Define faArchive for |CI$00000020
123
124// The file or directory is compressed.
125// For a file, this means that all of the data in the file is compressed.
126// For a directory, this means that compression is the default for newly created files and subdirectories.
127Define faCompressed for |CI$00000800
128
129// The handle identifies a directory.
130Define faDirectory for |CI$00000010
131
132// The file or directory is encrypted.
133// For a file, this means that all data in the file is encrypted.
134// For a directory, this means that encryption is the default for newly created files and subdirectories.
135Define faEncrypted for |CI$00000040
136
137// The file or directory is hidden.
138// It is not included in an ordinary directory listing.
139Define faHidden for |CI$00000002
140
141// The file or directory has no other attributes set.
142// This attribute is valid only if used alone.
143Define faNormal for |CI$00000080
144
145// The file data is not immediately available.
146// This attribute indicates that the file data has been physically moved to offline storage.
147// This attribute is used by Remote Storage, the hierarchical storage management software in Windows 2000.
148// Applications should not arbitrarily change this attribute.
149Define faOffline for |CI$00001000
150
151// The file or directory is read-only.
152// Applications can read the file but cannot write to it or delete it.
153// In the case of a directory, applications cannot delete it.
154Define faReadOnly for |CI$00000001
155
156// The file has an associated reparse point.
157Define faReparsePoint for |CI$00000400
158
159// The file is a sparse file.
160Define faSparseFile for |CI$00000200
161
162// The file or directory is part of the operating system,
163// or is used exclusively by the operating system.
164Define faSystem for |CI$00000004
165
166// The file is being used for temporary storage.
167// File systems attempt to keep all of the data in memory for quicker access, rather than flushing it back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.
168Define faTemporary for |CI$00000100
169
170