files-root
Serve static content over HTTP or HTTPS
Syntax
--files-root
path
Description
--files-root
enables MATLAB®
Production Server™ to serve static content over HTTP or HTTPS.path
To access static file content from a web browser, provide the file name
file_name.ext
(where ext is the file extension), host name
server_host_name
, and port server_port
in the
format
http(s):server_host_name:server_port/~files/file_name.ext
.
Parameters
path
Path to the folder containing static files.
Examples
For on-premises server instances created using the command line, update this server configuration property in the
main_config
server configuration file.For on-premises server instances created using the dashboard and for server deployments in the cloud, use the dashboard and cloud dashboard, respectively, to update the server configuration property.
Serve Static Content
Assume that you have a server running at the host name
my.server.com
and port number 9910.
Assume that you have a text file,
my_file.txt
, stored in a folder calledstatic_files
, andstatic_files
is located in the root folder of your server instance.In the
main_config
server configuration file, specify the path to thestatic_files
folder as the parameter to thefiles-root
property.--files-root ./static_files
Assume that you have a text file,
my_file.txt
, stored in a folder calledstatic_files
, andstatic_files
is located in theC:\tmp
folder.In the dashboard, in the Settings tab of your server instance, under Advanced, enter the following for the Additional Options property.
--files-root C:\tmp\static_files
To access my_file.txt
from a web browser, specify the following in
the address bar of your browser,
http:my.server.com:9910/~files/my_file.txt
.