xamarin / Essentials

Xamarin.Essentials is no longer supported. Migrate your apps to .NET MAUI, which includes Maui.Essentials.
https://aka.ms/xamarin-upgrade
Other
1.52k stars 505 forks source link

[Bug] Content type property is returning "application/octet-stream" #2021

Open shanmugasundar-sf3429 opened 2 years ago

shanmugasundar-sf3429 commented 2 years ago

Description

In Xamarin.forms Android and IOS when tried to read a pdf, the content type is returning as "application/pdf". Whereas in Xamarin forms UWP alone the content type is returned as "application/octet-stream"

Steps to Reproduce

  1. Place a pdf in specified "folderPath" location which is mention in attached sample.
  2. Get the "file path" using "Path.Combine" method.
  3. Initialize "ReadOnlyFile" object with the "file path" as parameter for getting information of the mention pdf file.
  4. Get the "content type" property value from the created "ReadOnlyFile" object.

Expected Behavior

when tried to read a pdf, the content type is expected to return "application/pdf"

Actual Behavior

when tried to read a pdf, the content type is returning "application/octet-stream"

Basic Information

Reproduction Link

https://drive.google.com/file/d/1_aAQwNblR4oxPwENdCiK7E6bG1sHEfRf/view?usp=sharing