Table of Contents

Class FileController

Namespace
Oqtane.Controllers
Assembly
Oqtane.Server.dll
[Route("api/[controller]")]
public class FileController : Controller
Inheritance
FileController

Constructors

FileController(IWebHostEnvironment, IFileRepository, IFolderRepository, IUserPermissions, ISettingRepository, ISyncManager, ILogManager, ITenantManager, IImageService)

public FileController(IWebHostEnvironment environment, IFileRepository files, IFolderRepository folders, IUserPermissions userPermissions, ISettingRepository settingRepository, ISyncManager syncManager, ILogManager logger, ITenantManager tenantManager, IImageService imageService)

Parameters

environment IWebHostEnvironment
files IFileRepository
folders IFolderRepository
userPermissions IUserPermissions
settingRepository ISettingRepository
syncManager ISyncManager
logger ILogManager
tenantManager ITenantManager
imageService IImageService

Methods

Delete(int)

[HttpDelete("{id}")]
[Authorize(Roles = "Registered Users")]
public void Delete(int id)

Parameters

id int

DownloadAttachment(int)

Get file with header Content-Disposition: attachment; filename="filename.jpg" https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

[HttpGet("download/{id}/attach")]
public IActionResult DownloadAttachment(int id)

Parameters

id int

File Id from Oqtane filesystem

Returns

IActionResult

DownloadInline(int)

[HttpGet("download/{id}")]
public IActionResult DownloadInline(int id)

Parameters

id int

File Id from Oqtane filesystem

Returns

IActionResult

file content

Get(int)

[HttpGet("{id}")]
public File Get(int id)

Parameters

id int

Returns

File

Get(int, string)

[HttpGet("{siteId}/{path}")]
public IEnumerable<File> Get(int siteId, string path)

Parameters

siteId int
path string

Returns

IEnumerable<File>

Get(string)

[HttpGet]
public IEnumerable<File> Get(string folder)

Parameters

folder string

Returns

IEnumerable<File>

Get(string, int)

[HttpGet("name/{name}/{folderId}")]
public File Get(string name, int folderId)

Parameters

name string
folderId int

Returns

File

GetImage(int, int, int, string, string, string, string, string)

[HttpGet("image/{id}/{width}/{height}/{mode}/{position}/{background}/{rotate}/{recreate}")]
public IActionResult GetImage(int id, int width, int height, string mode, string position, string background, string rotate, string recreate)

Parameters

id int
width int
height int
mode string
position string
background string
rotate string
recreate string

Returns

IActionResult

Post(File)

[HttpPost]
[Authorize(Roles = "Registered Users")]
public File Post(File file)

Parameters

file File

Returns

File

Put(int, File)

[HttpPut("{id}")]
[Authorize(Roles = "Registered Users")]
public File Put(int id, File file)

Parameters

id int
file File

Returns

File

Unzip(int)

[HttpPut("unzip/{id}")]
[Authorize(Roles = "Administrators")]
public void Unzip(int id)

Parameters

id int

UploadFile(string, IFormFile)

[EnableCors("MauiCorsPolicy")]
[HttpPost("upload")]
public Task<IActionResult> UploadFile(string folder, IFormFile formfile)

Parameters

folder string
formfile IFormFile

Returns

Task<IActionResult>

UploadFile(string, string, string)

[HttpGet("upload")]
public Task<File> UploadFile(string url, string folderid, string name)

Parameters

url string
folderid string
name string

Returns

Task<File>