Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Andriy V.'s avatar
Andriy V.
New member | Level 1
10 years ago

Stream from GetContentAsStreamAsync with Exceptions

Hello! I can't understand what I'm doing wrong. After calling GetContentAsStreamAsync method I get stream as a result, but this stream contains Lenght and Position properties with such exception: Length = '((System.Net.Http.DelegatingStream)data).Length' threw an exception of type 'System.NotSupportedException'.

1 Reply

Replies have been turned off for this discussion
  • Hi Andriy,

    Length and Position are available only if CanSeek property of the stream is true and not all stream supports seeking (FileStream and MemoryStream can seek but NetworkStream cannot). You shouldn't make the assumption that the stream returned by GetContentAsStreamAsync supports seeking.

     

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!