Thank you for your quick answer.
I checked issue 14706 and I think it will be preferred if you return the total length in byte of the file that is being download/uploading and the current number of bytes downloaded/uploaded.
I think this kind of information is very needed for the end user when when dealing with very big file. At this moment, I have tested with 50 MB files approx, but planned to download/upload 400 MB files.
I tracked your code and I think (if I am not wrong) that the delegate or event could be implemented in the following method execution chain:
class : DropBoxFileStream
private void DownloadData()
Stream data = _session.RequestRessourceStreamByUrl(_url + "/" + EncodingHelper.UTF8Encode(_file));
if (Length > 0 && CanSeek)
Position = 0;
StreamHelper class: Next, following CopyStreamData will be the final implementation:
public static void CopyStreamData(Stream src, Stream trg)
// validate parameter
if (src == null || trg == null)
if (src.CanRead == false || trg.CanWrite == false)
// build the buffer as configured
byte buffer = new byte[_BufferSize];
// copy the stream data
int readBytes = 0;
readBytes = src.Read(buffer, 0, _BufferSize);
if (readBytes > 0)
trg.Write(buffer, 0, readBytes);
} while (readBytes > 0);