Hi,Â
I actually tried that... but it appears to write to that stream before it actually starts uploading.... i.e. looking at my network adapter - i can see that bytes only start moving after my progress has reached 100%....
I've some sample code below - could you take a look and see if what I'm experiencing is expected? Â (To complicate things, I'm gzipping my upload).
Thanks,Â
Chris
 var upload = new RestRequest("fileapi/upload/test.file", Method.POST);
                       var fp = FileParameter.Create(Path.GetFileNameWithoutExtension(destinationPath), new byte[0], path);
                       fp.Writer = s =>
                               {
                                 fr.Position = 0;
                                 var ms = new MemoryStream();
                                 using (var gz = new GZipStream(ms, CompressionMode.Compress))
                                   fr.CopyTo(gz);
                                 var ms2 = new MemoryStream(ms.GetBuffer());
                                 ms.Dispose();
                                 var buffer = new byte[8192];
                                 int read; long totalread = 0;
                                 while ((read = ms2.Read(buffer, 0, buffer.Length)) > 0)
                                 {
                                   totalread += read;
                                   s.Write(buffer, 0, read);
                                   // s.Flush() doesn't affect progress here....
                                   NotifyProgress(destinationPath, totalread, ms2.Length);
                                 }
                               };
                       upload.Files.Add(fp);
                       client.Execute(upload);