4

I am using DropNet library to download files from Dropbox.

public Stream GetFileStream(string path)
    {
        return new MemoryStream(dropboxClient.GetFile(path));
    }

I am facing a problem in downloading large files because DropNet library returns byte array then I convert that byte array to stream for another logical purposes using MemoryStream which is not good because I have to download files to server memory then complete my logic I am trying to find a way to buffer that files as a stream.

I looked at BufferedStream Class but to create new buffersteam it requires a stream first. I can't figure the best solution for my problem.

1 Answer 1

2

The DropNet API does not expose a Stream functionality for retrieving files. You must wait for the entire file to be downloaded before you can use it. If you want to be able to read the stream as it comes in you will need to use a different library, modify an existing one, or write your own.

Sign up to request clarification or add additional context in comments.

2 Comments

Or possibly modify the DropNet library, since it's open source.
@svick you would actually need to modify RestSharp as that is what DropNet is using internally to communicate with dropbox and RestSharp does not provide a Stream response.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.