The disk filesystem gives access to the actual directory that has been provided in the configuration as storage.disk.dir. It accessible only for retrieval via HTTP under /.
Given that the requested file exists, the returned Content-Type
is based solely on the file extension. For a list of known mime-types and their extensions see storage.mime_types in the configuration.
The contents of the disk filesystem at / are also accessible via the API in the same way as described above, but with the same protection as the API (see API-Security configuration) for all operations. It is also possible to list all files that are currently in the filesystem.
Example:
Path is the complete file path incl. file name (/a/b/c/1.txt).
The contents for the upload has to be provided as an io.Reader
.
After the successful upload the file is available at /example.txt
and /api/v3/fs/disk/example.txt
.
Description:
Listing all currently stored files is done by calling /api/v3/fs/disk
. It also accepts the query parameters pattern
, sort
(name,
size,
or lastmod
) and order
(asc
or desc
). If none of the parameters are given, all files will be listed sorted by their last modification time in ascending order.
With the pattern
parameter you can filter the list based on a glob pattern, with the addition of the **
placeholder to include multiple subdirectories, e.g. listing all .ts
file in the root directory has the pattern /*.ts
, listing all .ts
file in the whole filesystem has the pattern /**.ts
.Example:
Description:
For downloading a file you have to specify the complete path and filename. The Content-Type
will always be application/data
.
Example:
The returned data is an io.ReadCloser
.
Description:
For deleting a file you have to specify the complete path and filename.
Example:
Description:
The API allows you to manipulate the contents of the available filesystems.
S3 filesystems are only accessible via HTTP their configured mountpoint. Use the POST
or PUT
method with the path to that file to (over-)write a file. The body of the request contains the contents of the file. No particular encoding or Content-Type
is required. The file can then be downloaded from the same path.
This filesystem is practical rarely changing data (e.g. VOD) for long term storage.
On this page and in the examples we assume that a S3 storage with the name aws
is mounted on /awsfs
.
The returned Content-Type
is based solely on the file extension. For a list of known mime-types and their extensions see storage.mime_types in the configuration.
It is strongly recommended to enable a username/password (HTTP Basic-Auth) protection for any PUT/POST
and DELETE
operations on /memfs. GET
operations are not protected.
By default HTTP Basic-Auth is not enabled.
The contents of the S3 filesystem mounted on /awsfs
are also accessible via the API in the same way as described above, but with the same protection as the API (see API-Security configuration) for all operations. It is also possible to list all files that are currently in the filesystem.
Example:
The contents for the upload has to be provided as an io.Reader
.
After the successful upload the file is available at /awsfs/example.txt
and /api/v3/fs/aws/example.txt
.
Description:
Listing all currently stored files is done by calling /api/v3/fs/aws
. It also accepts the query parameters pattern
, sort
(name,
size,
or lastmod
) and order
(asc
or desc
). If none of the parameters are given, all files will be listed sorted by their last modification time in ascending order.
With the pattern
parameter you can filter the list based on a glob pattern, with the addition of the **
placeholder to include multiple subdirectories, e.g. listing all .ts
file in the root directory has the pattern /*.ts
, listing all .ts
file in the whole filesystem has the pattern /**.ts
.
Example:
Description:
For downloading a file you have to specify the complete path and filename. The Content-Type
will always be application/data
.
Example:
The returned data is an io.ReadCloser
.
Description:
For deleting a file you have to specify the complete path and filename.
Example:
Description:
A very simple in-memory filesystem is available which is only accessible via HTTP under /memfs
. Use the POST
or PUT
method with the path to that file. The body of the request contains the contents of the file. No particular encoding or Content-Type
is required. The file can then be downloaded from the same path.
This filesystem is practical for often changing data (e.g. HLS live stream) in order not to stress the disk or to wear out a flash drive. Also you don't need to setup a RAM drive or similar on your system.
The returned Content-Type
is based solely on the file extension. For a list of known mime-types and their extensions see storage.mime_types in the configuration.
It is strongly recommended to enable a username/password (HTTP Basic-Auth) protection for any PUT/POST
and DELETE
operations on /memfs. GET
operations are not protected.
By default HTTP Basic-Auth is enabled with the username "admin" and a random password.
Use these endpoints to, e.g., store HLS chunks and .m3u8 files (in contrast to an actual disk or a ramdisk):
Then you can play it generally with, e.g.,
ffplay http://127.0.0.1:8080/memfs/foobar.m3u8
.
The contents of the /memfs
are also accessible via the API in the same way as described above, but with the same protection as the API (see API-Security configuration) for all operations. It is also possible to list all files that are currently in the filesystem.
Example:
The contents for the upload has to be provided as an io.Reader
.
After the successful upload the file is available at /memfs/example.txt
and /api/v3/fs/mem/example.txt
.
Description:
Listing all currently stored files is done by calling /api/v3/fs/mem
. It also accepts the query parameters pattern
, sort
(name,
size,
or lastmod
) and order
(asc
or desc
). If none of the parameters are given, all files will be listed sorted by their last modification time in ascending order.
With the pattern
parameter you can filter the list based on a glob pattern, with the addition of the **
placeholder to include multiple subdirectories, e.g. listing all .ts
file in the root directory has the pattern /*.ts
, listing all .ts
file in the whole filesystem has the pattern /**.ts
.
Example:
Description:
For downloading a file you have to specify the complete path and filename. The Content-Type
will always be application/data
.
Example:
The returned data is an io.ReadCloser
.
Description:
Linking a file will return a redirect to the linked file. The target of the redirect has to be in the body of the request.
Example:
This is not implemented in the client.
Description:
For deleting a file you have to specify the complete path and filename.
Example:
Description:
List all files on a filesystem. The listing can be ordered by name, size, or date of last modification in ascending or descending order.
Name of the filesystem
glob pattern for file names
none, name, size, lastmod
asc, desc
OK
Remove a file from a filesystem
Name of the filesystem
Path to file
OK
Fetch a file from a filesystem
Name of the filesystem
Path to file
OK
Writes or overwrites a file on a filesystem
Name of the filesystem
Path to file
File data
Created
List all files on the memory filesystem. The listing can be ordered by name, size, or date of last modification in ascending or descending order.
glob pattern for file names
none, name, size, lastmod
asc, desc
OK
Remove a file from the memory filesystem
Path to file
OK
Remove a file from the memory filesystem
Path to file
OK
Fetch a file from the memory filesystem
Path to file
OK
Create a link to a file in the memory filesystem. The file linked to has to exist.
Path to file
Path to the file to link to
Created
Fetch a file from the memory filesystem
Path to file
OK
Writes or overwrites a file on the memory filesystem
Path to file
File data
Created
Writes or overwrites a file on the memory filesystem
Path to file
File data
Created