2using System.ComponentModel.DataAnnotations;
4using System.Threading.Tasks;
6using Microsoft.AspNetCore.Mvc;
7using Microsoft.Extensions.Logging;
42 ILogger<ApiController> logger)
45 authenticationContextFactory,
64 public Task<IActionResult>
Download([Required, FromQuery]
string ticket, CancellationToken cancellationToken)
78 [ProducesResponseType(204)]
80 public async Task<IActionResult>
Upload([Required, FromQuery]
string ticket, CancellationToken cancellationToken)
92 return result.ErrorCode == ErrorCode.ResourceNotPresent
Sanity limits to prevent users from overloading.
const int MaximumFileTransferSize
The maximum size for file transfers.
Represents an error message returned by the server.
Response for when file transfers are necessary.
Routes to a server actions.
const string Transfer
The transfer controller.
Base Controller for API functions.
Very similar to FileStreamResult except it's IActionResultExecutor<TResult> contains a fix for https:...
ApiController for file streaming.
Task< IActionResult > Download([Required, FromQuery] string ticket, CancellationToken cancellationToken)
Downloads a file with a given ticket .
readonly IFileTransferStreamHandler fileTransferService
The IFileTransferStreamHandler for the TransferController.
async Task< IActionResult > Upload([Required, FromQuery] string ticket, CancellationToken cancellationToken)
Uploads a file with a given ticket .
TransferController(IDatabaseContext databaseContext, IAuthenticationContextFactory authenticationContextFactory, IFileTransferStreamHandler fileTransferService, ILogger< ApiController > logger)
Initializes a new instance of the TransferController class.
For creating and accessing authentication contexts.
Reads and writes to Streams associated with FileTicketResponses.
Task< ErrorMessageResponse > SetUploadStream(FileTicketResponse ticket, Stream stream, CancellationToken cancellationToken)
Sets the Stream for a given ticket associated with a pending upload.
ErrorCode
Types of Response.ErrorMessageResponses that the API may return.