AzureStorageUploadAsync Method

This method uploads a file submitted with the request

Definition

Namespace: MobileTrack.DataContainers.FileStorage
Assembly: MobileTrack.DataContainers (in MobileTrack.DataContainers.dll) Version: 0.8+34f1bbd8dc6b32752cfce829cbed66e15113d7ba
public Task<BlobDto?> UploadAsync(
	CompanyDto owner,
	AccountDto uploadedBy,
	string fileName,
	MemoryStream contents,
	FileResourceTypeMap tag,
	IProgress<long>? progressHandler = null,
	CancellationToken cancellationToken = default
)

Parameters

owner  CompanyDto
Company owning the file.
uploadedBy  AccountDto
User uploading the file.
fileName  String
Name of the file
contents  MemoryStream
Stream of the contents. Use this parameter in a 'using' context!
tag  FileResourceTypeMap
file tag. Must be derived from the ImageResourceTypeMap
progressHandler  IProgressInt64  (Optional)
Optional: a Progress Handler that is invoked every time the upload proceeds (20%, 40%, etc.)
cancellationToken  CancellationToken  (Optional)
Optional: cancellation token for upload Task

Return Value

TaskBlobDto
The generated blob; if , this means the file already exists

Implements

IAzureStorageUploadAsync(CompanyDto, AccountDto, String, MemoryStream, FileResourceTypeMap, IProgressInt64, CancellationToken)

Exceptions

ArgumentExceptionInvoked if fileName is IsNullOrEmpty(String) or if tag is Empty
ArgumentNullExceptionInvoked if owner, uploadedBy or contents is .

See Also