1
votes

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);
    }
}
1

1 Answers