-
Notifications
You must be signed in to change notification settings - Fork 51
File Station API
The FileStation API is an AuthenticatedAPI
, that means the user needs to be authenticated before using this API.
Fortunately, the AuthenticatedAPI
is smart enough to automatically log the user.
The syno
object uses the fs
(or fileStation
alias) property to interact with the FileStation API.
Provide File Station information.
Method Name | Description | Required params |
---|---|---|
getFileStationInfo(callback) |
Provide File Station information | - |
List all shared folders, enumerate files in a shared folder, and get detailed file information.
Method Name | Description | Required params |
---|---|---|
listSharedFolders(params, callback) |
List all shared folders | - |
listFiles(params, callback) |
Enumerate files in a given folder | folder_path |
getFilesInfo(params, callback) |
Get information of file(s) | path |
Search files according to given criteria.
This is a non-blocking API. You need to start to search files with the start method. Then, you should poll requests with list method to get more information, or make a request with the stop method to cancel the operation. Otherwise, search results are stored in a search temporary database so you need to call clean method to delete it at the end of operation.
Method Name | Description | Required params |
---|---|---|
startSearch(params, callback) |
Start to search files according to given criteria. If more than one criterion is given in different parameters, searched files match all these criteria | folder_path |
stopSearch(params, callback) |
Stop the searching task(s). The search temporary database won’t be deleted, so it’s possible to list the search result using list method after stopping it | folder_path |
listSearch(params, callback) |
List matched files in a search temporary database. You can check the finished value in response to know if the search operation is processing or has been finished | taskid |
cleanSearches(params, callback) |
Delete search temporary database(s) | - |
List all mount point folders of virtual file system, ex: CIFS or ISO.
Method Name | Description | Required params |
---|---|---|
listVirtualFolders(params, callback) |
List all mount point folders on one given type of virtual file system | - |
Add a folder to user’s favorites or perform operations on user’s favorites.
Method Name | Description | Required params |
---|---|---|
listFavorites(params, callback) |
List user’s favorites | - |
addFavorite(params, callback) |
Add a folder to user’s favorites |
path name
|
deleteFavorite(params, callback) |
Delete a favorite in user’s favorites | path |
cleanBrokenFavorites(params, callback) |
Delete all broken statuses of favorites | - |
editFavorite(params, callback) |
Edit a favorite name | - |
replaceAllFavorites(params, callback) |
Replace multiple favorites of folders to the existed user’s favorites |
path name
|
Get a thumbnail of a file.
Method Name | Description | Required params |
---|---|---|
getThumbnail(params, callback) |
Get a thumbnail of a file | path |
Get the accumulated size of files/folders within folder(s).
This is a non-blocking API. You need to start it with the start method. Then, you should poll requests with the status method to get progress status or make a request with stop method to cancel the operation.
Method Name | Description | Required params |
---|---|---|
startDirSize(params, callback) |
Start to calculate size for one or more file/folder paths | path |
statusDirSize(params, callback) |
Get the status of the size calculating task | taskid |
stopDirSize(params, callback) |
Stop to calculate size | taskid |
Get MD5 of a file.
This is a non-blocking API. You need to start it with the start method. Then, you should poll requests with status method to get the progress status, or make a request with the stop method to cancel the operation.
Method Name | Description | Required params |
---|---|---|
startMD5(params, callback) |
Start to get MD5 of a file | file_path |
statusMD5(params, callback) |
Get the status of the calculating MD5 task | taskid |
stopMD5(params, callback) |
Stop calculating the MD5 of a file | taskid |
Check if a logged-in user has a permission to do file operations on a given folder/file.
Method Name | Description | Required params |
---|---|---|
checkWritePermission(params, callback) |
Check if a logged-in user has write permission to create new files/folders in a given folder | path |
Generate a sharing link to share files/folders with other people and perform operations on sharing link(s).
Method Name | Description | Required params |
---|---|---|
getSharingLinkInfo(params, callback) |
Get information of a sharing link by the sharing link ID | id |
listSharingLinks(params, callback) |
List user’s file sharing links | - |
createSharingLinks(params, callback) |
Generate one or more sharing link(s) by file/folder path(s) | path |
deleteSharingLinks(params, callback) |
Delete one or more sharing links | id |
clearInvalidSharingLinks(params, callback) |
Remove all expired and broken sharing links | - |
editSharingLinks(params, callback) |
Edit sharing link(s) | id |
Create folders.
Method Name | Description | Required params |
---|---|---|
createFolder(params, callback) |
Create folders |
folder_path name
|
Rename a file/folder.
Method Name | Description | Required params |
---|---|---|
rename(params, callback) |
Rename a file/folder |
path name
|
Copy/move file(s)/folder(s).
This is a non-blocking API. You need to start to copy/move files with start method. Then, you should poll requests with status method to get the progress status, or make a request with stop method to cancel the operation.
Method Name | Description | Required params |
---|---|---|
startCopyMove(params, callback) |
Start to copy/move files |
path dest_folder_path
|
statusCopyMove(params, callback) |
Get the copying/moving status | taskid |
stopCopyMove(params, callback) |
Stop a copy/move task | taskid |
Delete file(s)/folder(s).
There are two kinds of methods; one is a non-blocking method; and the other is a blocking method.
With the non-blocking method, you can start the deletion operation using the start method. Then, you should poll a request with the status method to get more information or make a request with the stop method to cancel the operation.
With the blocking method, you can directly make requests with delete method to delete files/folders, but the response is not returned until the delete operation is completed.
Method Name | Description | Required params |
---|---|---|
startDelete(params, callback) |
Delete file(s)/folder(s) | path |
statusDelete(params, callback) |
Get the deleting status | taskid |
stopDelete(params, callback) |
Stop a delete task | taskid |
delete(params, callback) |
Delete files/folders (blocking) | path |
Extract an archive and perform operations on archive files.
This is a non-blocking API. You need to start to extract files with start method. Then, you should poll requests with status method to get the progress status, or make a request with the stop method to cancel the operation.
Method Name | Description | Required params |
---|---|---|
startExtract(params, callback) |
Start to extract an archive |
file_path dest_folder_path
|
statusExtract(params, callback) |
Get the extract task status | taskid |
stopExtract(params, callback) |
Stop the extract task | taskid |
listArchiveFiles(params, callback) |
List archived files contained in an archive | file_path |
Compress file(s)/folder(s).
This is a non-blocking API. You need to start to compress files with the start method. Then, you should poll requests with the status method to get compress status, or make a request with the stop method to cancel the operation.
Method Name | Description | Required params |
---|---|---|
startCompress(params, callback) |
Start to compress file(s)/folder(s) |
path dest_folder_path
|
statusCompress(params, callback) |
Get the compress task status | taskid |
stopCompress(params, callback) |
Stop the compress task | taskid |
Get information regarding tasks of file operations which is run as the background process including copy, move, delete, compress and extract tasks with non-blocking API/methods. You can use the status method to get more information, or use the stop method to cancel these background tasks in individual API, such as SYNO.FileStation.CopyMove API, SYNO.FileStation.Delete API, SYNO.FileStation.Extract API and SYNO.FileStation.Compress API.
Method Name | Description | Required params |
---|---|---|
listBackgroundTasks(params, callback) |
List all background tasks including copy, move, delete, compress and extract tasks | - |
clearFinishedBackgroundTasks(params, callback) |
Delete all finished background tasks | - |
Download file(s)/folder(s).
Method Name | Description | Required params |
---|---|---|
download(params, callback) |
Download files/folders. If only one file is specified, the file content is responded. If more than one file/folder is given, binary content in ZIP format which they are compressed to is responded |
path stream
|
N.B. : stream
param must be a Writable Stream
Upload a file.
Method Name | Description | Required params |
---|---|---|
upload(params, callback) |
Upload a file by RFC 1867. | |
Note that each parameter is passed within each part but binary file data must be the last part |
dest_folder_path filename
|
N.B. : It seems like a fex bytes are not sent, dunno why. Still working on it.