contents   index   previous   next



FileRequest

 

Data As String

 

If TrapFileEnable is set to TRUE, all incoming requests will fire the FileRequest event. When this event is fired, WebX will pass the name of the requested object (HTML page, gif file, etc.) and the entire Query String to the application. The developer can then decide if they want to TRAP the page and provide the output to the client or if WebX should try to honor the request. See the example below.

 

 

Parameter

Type

Description

Index

Integer

The index of the connection requesting a file.

FileName

String

The name of the file being requested. The virtual path is included in file. E.g. If you request the following page http://www.mydomain.com/products/index.html, FileName will contain "/products/index.html".

UserAuthentication

String

The user name and password for restricted directories. The format is: username:password.

 

For Example:

Private Sub WebX1_FileRequest (Index As Integer, FileName As String)        

    If UCase(FileName) = UCase("/trap.html") Then        

       Debug.Print FileName & QueryString                

       ' Send data back to Server Engine        

       WebX1.TrapFileData Index, "A Trapped Page.", False    Else        

       WebX1.TrapFileData Index, "", True    

     End If    

End Sub

 

In the above example, if FileName is trap.html, then the test "A trapped Page. " will be sent to the client. Otherwise, WebX1.TrapFileData Index, "", True is executed which forwards the request back to WebX. See the Methods section for more information on the method TrapFileData.

 

HTTPLog