Exemplo n.º 1
0
        public async Task <UploadStartResponse> UploadDropBoxAsync([FromBody] DropBoxRequest model,
                                                                   [FromServices] IRestClient client,
                                                                   [FromServices] IDocumentDirectoryBlobProvider documentDirectoryBlobProvider,
                                                                   CancellationToken token)
        {
            var(stream, _) = await client.DownloadStreamAsync(model.Link, token);

            var blobName = BlobFileName(Guid.NewGuid(), model.Name);
            await documentDirectoryBlobProvider.UploadStreamAsync(blobName, stream, token : token);

            return(new UploadStartResponse(blobName));
        }