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);
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
source
share