createVirtualDirectoryFile

createVirtualDirectoryFile(filename: String;
                           contents: Binary;
                           retain:   Boolean): Integer;

The createVirtualDirectoryFile method of the JadeRestService class enables you to pass files created by a JADE application to the jadehttp library. The jadehttp library creates the specified file in the directory specified by the VirtualDirectory parameter in the jadehttp.ini file.

The createVirtualDirectoryFile method parameters are listed in the following table.

Parameter Description
filename Name of the file to be created in the virtual directory
contents Binary holding the file contents
retain Creates read-only files when set to true or standard files when set to false

The jadehttp library creates the specified file in the directory (the virtual directory visible to Web browsers) in which the library is running. This method returns zero (0) if the method successfully formats a request to the jadehttp library or it returns the non-zero operating system error code indicating the failure to create the file.

You can specify whether files created in the virtual directory are deleted automatically and how this happens, by setting the PurgeDirectoryRule parameter in the [application-name] section of the jadehttp.ini file or the PurgeDirectoryRule configuration directive in the JADE mod_jadehttp file. If this parameter or directive is not set, files of type .jpg, .png, or .gif that are more than 12 hours old are removed. For details, see "Internal Housekeeping of the Virtual Directory", in Chapter 2 of the JADE Installation and Configuration Guide.

This method must be called from an end point method that is being executed when called from a REST Services request.

2016.0.01 and higher