You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to download PDF file from ICloud and got
DocumentPicker.show({
filetype: ['com.adobe.pdf'],
}, (error, res) => {
const allowedType = ["image/jpeg", "image/png", "pdf"];
if (allowedType.includes(res.type) && res.fileSize < 2000000) {
const Name = "Document " + res.fileName.split(".")[0];
// todo GuidKey should gets from uploadFile endpoint response
const file = { Name, GuidKey: "" };
this.props.uploadDocument(res.uri, res.type, res.fileName, { Code: this.props.onBoardingCode});
// this.props.addFileToCurrentDocument(file);
} else if (!allowedType.includes(res.type)) {
Alert.alert("You can upload only jpeg, png or pdf");
} else {
Alert.alert("You can not upload a file larger than two megabytes");
}
});
If print res I've got fileName, fileSize and uri, but not "type" is there a bug?
React-native :0.43
Platform : IOS
The text was updated successfully, but these errors were encountered:
I found a solution to this. hfsTypeCode doesn't work, but Cocoa does have an API for interacting Apple's their database of UTIs and can be used to ask for the appropriate UTI for a file extension and then a mime type for a UTI.
I've tried to download PDF file from ICloud and got
DocumentPicker.show({
filetype: ['com.adobe.pdf'],
}, (error, res) => {
const allowedType = ["image/jpeg", "image/png", "pdf"];
If print res I've got fileName, fileSize and uri, but not "type" is there a bug?
React-native :0.43
Platform : IOS
The text was updated successfully, but these errors were encountered: