Vydia / react-native-background-upload

Upload files in your React Native app even while it's backgrounded. Supports Android and iOS, including camera roll assets.
MIT License
720 stars 325 forks source link

[IOS] File content type is always "application/octet-stream" #316

Open raedhellal opened 1 year ago

raedhellal commented 1 year ago

I had a problem with uploading document and the issue is that the content type is always "application/octet-stream" when i checked the code i found this function:

/ Borrowed from http://stackoverflow.com/questions/2439020/wheres-the-iphone-mime-type-database /

i guess this two lines don't work anymore to determine MIMEType CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[fileName pathExtension], NULL); CFStringRef MIMEType = UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType);

it is always null

bityogi commented 1 year ago

Hello,

Is there a way around this? We are trying to upload HEIF images from iOS devices (with an file extension of heic) and the contentType seems to be coming back as application/octet-stream and this is causing some issues for us because we need to redirect them for processing based on the contentType if they are heif images.