1

I am using dropnet (dropbox c# API) to upload files to dropbox. Problem is I need to do that in chunks to monitor progress. Just read at one place that Dropbox supports chunk upload (https://www.dropbox.com/developers/blog/21) and it has library for Java, etc. I need to do in C#, any help on this.

Dropnet uses restsharp and some say restsharp has to implement it. Below is the part where actual upload occurs

private static HttpWebResponse GetRawResponse(HttpWebRequest request)
{
 try
{
    return (HttpWebResponse)request.GetResponse();  // UPLOAD OCCURS HERE
}
catch (WebException ex)
{
if (ex.Response is HttpWebResponse)
{
return ex.Response as HttpWebResponse;
}
throw;
    }
}

Is there no way we can get progress bar by altering code? Also is there any way we can get progress bar for any REQUEST.GetResponse(), leave context of Dropbox (because this will solve our issue).

Thanks.

sujit
  • 135
  • 8

1 Answers1

0

I have recently updated the DropNet Library in NuGet with Chunked upload support so you could give that a try but that would mean splitting up your file into chunks and incrementing the progress bar each time which isn't ideal for small files.

Alternatively you could have a look at my new library DropNetRT which is based on Microsoft's HttpClient implementation and should be able to provide some progress feedback with some tweaking. https://github.com/dkarzon/DropNetRT

dkarzon
  • 7,868
  • 9
  • 48
  • 61