Interface IFileService
Service to get / create / upload / download files.
public interface IFileService
Methods
AddFileAsync(File)
Add / store a File record. This does not contain the file contents.
Task<File> AddFileAsync(File file)
Parameters
file
File
Returns
- Task<File>
DeleteFileAsync(int)
Delete a File
Task DeleteFileAsync(int fileId)
Parameters
fileId
int
Returns
- Task
DownloadFileAsync(int)
Get / download a file (the body).
Task<byte[]> DownloadFileAsync(int fileId)
Parameters
fileId
intReference to a File
Returns
- Task<byte[]>
The bytes of the file
GetFileAsync(int)
Get one File
Task<File> GetFileAsync(int fileId)
Parameters
fileId
int
Returns
- Task<File>
GetFileAsync(int, string)
Task<File> GetFileAsync(int folderId, string name)
Parameters
folderId
intReference to the Folder
name
stringname of the file
Returns
- Task<File>
GetFilesAsync(int)
Get all Files in the specified Folder
Task<List<File>> GetFilesAsync(int folderId)
Parameters
folderId
intThe folder ID
Returns
- Task<List<File>>
GetFilesAsync(int, string)
Task<List<File>> GetFilesAsync(int siteId, string folderPath)
Parameters
siteId
intReference to the Site
folderPath
stringPath of the folder TODO: todoc verify exactly from where the folder path must start
Returns
- Task<List<File>>
GetFilesAsync(string)
Get all Files in the specified folder.
Task<List<File>> GetFilesAsync(string folder)
Parameters
folder
stringThe folder path relative to where the files are stored. TODO: todoc verify exactly from where the folder path must start
Returns
- Task<List<File>>
UnzipFileAsync(int)
Task UnzipFileAsync(int fileId)
Parameters
fileId
int
Returns
- Task
UpdateFileAsync(File)
Update a File record. Use this for rename a file or change some attributes. This does not contain the file contents.
Task<File> UpdateFileAsync(File file)
Parameters
file
File
Returns
- Task<File>
UploadFileAsync(string, int, string)
Upload a file from a URL to a Folder
Task<File> UploadFileAsync(string url, int folderId, string name)
Parameters
url
stringfolderId
intname
string
Returns
- Task<File>