Firebase Mvc показывает проценты в индикаторе выполнения - PullRequest
0 голосов
/ 09 февраля 2019
// Get any Stream - it can be FileStream, MemoryStream or any other type of 
// Stream
var stream = File.Open(@"C:\Users\you\file.png", FileMode.Open);

// Constructr FirebaseStorage, path to where you want to upload the file and 
// Put it there
var task = new FirebaseStorage("your-bucket.appspot.com")
.Child("data")
.Child("random")
.Child("file.png")
.PutAsync(stream);

// Track progress of the upload
task.Progress.ProgressChanged += (s, e) => Console.WriteLine($"Progress: 
{e.Percentage} %");

 // await the task to wait until upload completes and get the download url
var downloadUrl = await task;

Как я могу вернуть процент для моего индикатора выполнения и показать процент загрузки для моих больших файлов. Мне нужно знать, что я должен вернуть ActionResult?JsonResult?ContentResult?и как я могу получить процент от моего сообщения ajax.

...