We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
Bobby I
6 years agoExplorer | Level 4
Download any file as a Stream using C# SDK
Hey, I'm wanting to download a file through the C# SDK, however I'm having issues when it is of the Dropbox .paper or similar cloud storage file type. I'm wanting it as a MemoryStream for my team and...
- 6 years ago
No, unfortunately the API doesn't offer the ability to request a different export type, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
Greg-DB
Dropbox Community Moderator
6 years agoYou have the right idea here. As you found, some cloud files, such as Paper docs, can't be downloaded via the normal Download method. You need to use Export for those instead.
You can either just try to Download the file and catch the UnsupportedFile error, at which point you would use Export instead, or you can check the file ahead of time by calling GetMetadata like you mentioned. If you do that though, you can use FileMetadata.IsDownloadable instead of checking ExportAs.
- Bobby I6 years agoExplorer | Level 4
I see. I think I will add a catch for this as you suggested and then attempt to export it. When I was attempting to export a paper file, the ExportAs value was always html. Through the Dropbox GUI, we're able to export as Markdown, Docx, or PDF. Is it possible to change how we want it to be exported programmatically? When it is html, we get a lot of extra fluff like styling and tags, when all we are realy interested in is the content.
- Greg-DB6 years ago
Dropbox Community Moderator
No, unfortunately the API doesn't offer the ability to request a different export type, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 13 hours ago
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 or Facebook.
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!