Table of Contents

Interface IFileService

Namespace
Oqtane.Services
Assembly
Oqtane.Client.dll

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 int

Reference 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)

Get a File based on the Folder and file name.

Task<File> GetFileAsync(int folderId, string name)

Parameters

folderId int

Reference to the Folder

name string

name of the file

Returns

Task<File>

GetFilesAsync(int)

Get all Files in the specified Folder

Task<List<File>> GetFilesAsync(int folderId)

Parameters

folderId int

The folder ID

Returns

Task<List<File>>

GetFilesAsync(int, string)

Retrieve a list of files from a Site and Folder

Task<List<File>> GetFilesAsync(int siteId, string folderPath)

Parameters

siteId int

Reference to the Site

folderPath string

Path 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 string

The 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 string
folderId int
name string

Returns

Task<File>