Exemple #1
0
        private async Task UploadVideoAsync(string replyToken, string messageId, string blobDirectoryName)
        {
            var videoStream = await MessagingClient.GetContentStreamAsync(messageId);

            var url = await BlobStorage.UploadFromStreamAsync(videoStream, blobDirectoryName, "video.mp4");

            await MessagingClient.ReplyMessageAsync(replyToken, url.ToString());
        }
        private async Task UploadMediaContentAsync(string replyToken, string messageId, string blobDirectoryName, string blobName)
        {
            var stream = await MessagingClient.GetContentStreamAsync(messageId);

            var ext = GetFileExtension(stream.ContentHeaders.ContentType.MediaType);
            var uri = await BlobStorage.UploadFromStreamAsync(stream, blobDirectoryName, blobName + ext);

            await MessagingClient.ReplyMessageAsync(replyToken, uri.ToString());
        }