From 70463c238aa3668c133cbfe88fe4646b1c46a4a6 Mon Sep 17 00:00:00 2001 From: Martin Hujer Date: Sat, 8 Mar 2014 22:33:37 +0100 Subject: [PATCH] Upload progress now works also for second file - Sent bytes must be reseted before new upload, otherwise "onprogress" event "loaded" value provides sum of uploaded bytes (not just for the current upload, but all of them) --- src/wp/FileTransfer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wp/FileTransfer.cs b/src/wp/FileTransfer.cs index f8b6ed5..6b18931 100644 --- a/src/wp/FileTransfer.cs +++ b/src/wp/FileTransfer.cs @@ -765,6 +765,8 @@ namespace WPCordovaClassLib.Cordova.Commands byte[] buffer = new byte[4096]; int bytesRead = 0; + //sent bytes needs to be reseted before new upload + bytesSent = 0; totalBytesToSend = fileStream.Length; requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);