SocketTools .NET Edition

HttpServer.FileAccess Enumeration

The supported file access permissions.

[Visual Basic]
Public Enum HttpServer.FileAccess
[C#]
public enum HttpServer.FileAccess

Remarks

File access permissions can restrict the actions that any client can take, regardless of the user permissions assigned to the client session. For example, a client session may have permission to use the PUT command; however, unless the folder that they are attempting to create the file in also has Write permission, the PUT command will fail.

For security reasons, when the server is started, regular files only have the Read permission and directories only have the Read and List permissions assigned to them. If you wish to allow clients to upload files to your server, or execute scripts stored in a directory, then you must create a virtual path to a physical directory and assign it the appropriate permissions. In both cases, best practices dictate that the physical directory should be located outside of the root directory of the server.

If you assign the Execute permission to a virtual directory to allow clients to execute scripts using the GET or POST commands, you should make sure that clients cannot list, create or modify files in that directory. The scripts in that directory must have a registered handler, created using the RegisterHandler method. It is not necessary to create a virtual path to a CGI program registered using the RegisterProgram method because execute permission for that program is granted by default.

Members

Member Name Description
None The virtual path or file has not been assigned any permissions.
Read If the virtual path specifies a file, the client can use the GET command to retrieve the contents of the file and the HEAD command will return information about the file. If the virtual path specifies a directory, the client can use the GET command to retrieve the index file for that directory. If the file or directory does not have this permission, the server will return an error to the client.
Write If the virtual path specifies a file, the client can modify the contents of the file using the PUT command. If the path specifies a directory, the client can use the PUT command to create a new file or replace an existing file in the directory.
Execute If the virtual path specifies a script, the client can execute the script using either the GET or POST commands. If the path specifies a directory, then all scripts in that directory can be executed.
List If the virtual path specifies a directory, and there is no default index file present, the server will return a list of files in that directory to the client. If this permission is not specified, the server will return an error if the directory does not have a default index file. It is recommended that you do not specify this permission when assigning the Execute permission to a directory
Restricted Access to the file or directory should be restricted to using the GET command to retrieve documents. This is effectively the same as only specifying Read as the file access permissions. If this permission is combined with any permission other than Read, those permissions will be ignored.
Protected Access to the file or directory is protected by a username and password. Clients should only be permitted to access the resource if they provide valid user credentials to the server. If this permission is assigned to a virtual path, the default command handlers will require the client to authenticate itself to permit access to the resource. The server application is responsible for authenticating the session.
Default This value specifies that the default access permissions should be granted to the file or directory. If the virtual path specifies a file, the client can use the GET command to return the contents. If the path specifies a directory, the client can use the GET command to return the index file or a list of files in the directory. If the server is in restricted mode, it will return an error if a directory does not have an index page.

Requirements

Namespace: SocketTools

Assembly: SocketTools.HttpServer (in SocketTools.HttpServer.dll)

Version: 12.0.3041.1380