Backendless Support
 
Answered

Uploadcallback .NET Backendless 4

i'm having trouble monitoring upload progress using UploadCallback when using this code

the file is uploaded fine my only problem is the ProgressHandler goes straight to 100 , i tried larger files also , it only returns 100

Thanks for the help

  1. void counter(int progress)
  2. {
  3. Console.WriteLine(progress);
  4. }
  5. ProgressHandler progressHandler = new ProgressHandler(counter);
  6. UploadCallback uploadCallback = new UploadCallback(progressHandler);
  7. FileStream fileStream = new FileStream(ProjectCover, FileMode.Open, FileAccess.Read);
  8. Backendless.Files.Upload(fileStream, locatino, true, uploadCallback, new AsyncCallback<BackendlessFile>(result =>
  9. {
  10. Console.WriteLine("LINK " + result.FileURL);
  11. Console.WriteLine("UPLOAD FINISHED AT " + DateTime.Now.TimeOfDay.ToString());
  12. }, fault =>
  13. {
  14. }));

Leave a Comment

Comments (6)

photo
1

Hello,

I believe you have to check some dot net documentation.

photo
1

there is not dot net documentation for version 4 , and i tried a different code also , but same result , progress goes straight to 100

photo
1

I mean not backendless .net documentation, but microsoft .net documentation. Because the client knows how many bytes it sends to the server and can calculate the progress.

photo
1

can i get a sample of that because even the backendless v3 samples from Github doesn't include uploading files with progress

photo
1

I have created internal ticket BKNDLSS-16896 to create a sample.

photo
1

Thank you so much , its just that am using the .net api with Websites and PC applications ,