We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

nguyenthanhliem's avatar
nguyenthanhliem
New member | Level 2
6 years ago

Error in call to API function "files/download"

I use DropBox API to implement Dropbox in Xamarin.Forms (NET Standard). I upload a file success, but when I download I get this error

Dropbox.Api.BadInputException: Error in call to API function "files/download": Bad HTTP "Content-Type" header: "application/x-www-form-urlencoded". Expecting one of "text/plain", "text/plain; charset=utf-8", "application/octet-stream", "application/octet-stream; charset=utf-8".

using (var client = new DropboxClient(this.AccessToken)) { using (var response = await client.Files.DownloadAsync(file.FilePath + "/" + file)) { var pickedFile = await response.GetContentAsByteArrayAsync(); //FileImagePreview.Source = ImageSource.FromStream(() => pickedFile); } }