Upload large files (200 MB) to Dropbox

I have a problem.

WCF is working for me. The idea is that the service will upload files (200 MB) to your DropBox account.

I tried SharpBox and DropNet. Everything works like a charm until I try to upload files. This means that logging into Dropbox and creating a folder works, but the download does not work ...

This is what I have tried so far:

SharpBox code path 1:

ICloudFileSystemEntry file = _storage.CreateFile(_folderEntry, Path.GetFileName(fileToUpload));

using (FileStream fileStream = new FileStream(fileToUpload, FileMode.Open, FileAccess.Read))
    {

Int32 length = 1024;
    int bytesRead = 0;
    Byte[] buffer = new Byte[length];

    using (Stream data = file.GetContentStream(FileAccess.Write))
    {

        using (BinaryWriter writer = new BinaryWriter(data))
        {

            bytesRead = fileStream.Read(buffer, 0, length);
            // write the required bytes
            while (bytesRead > 0)
            {
                bytesRead = fileStream.Read(buffer, 0, length);
                writer.Write(buffer, 0, bytesRead);
            }

        }
    }
}

SharpBox code path 2:

_storage.UploadFile(fileToUpload, _folderEntry);

DropNet code path 3:

byte[] content = _client.GetFileContentFromFS(new FileInfo(fileToUpload)); 
_client.UploadFile(_dropBoxFolder, Path.GetFileName(fileToUpload), content);

In webconfig:

<httpRuntime maxRequestLength="2097151" executionTimeout="3600" />

and

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="2147483648"/>
  </requestFiltering>
</security>

/ GΓΆran

+3
source share
1 answer

Have you set the maximum file length in your web configuration?

<system.web>
  <httpRuntime executionTimeout="240" maxRequestLength="20480" />
</system.web>
0
source

All Articles