jibon57 / nativescript-mediafilepicker

A complete file picker solution for NativeScript
Apache License 2.0
51 stars 36 forks source link

Custom File Picker in iOS giving error while copying pdf file to app directory. #107

Closed Shubhangvanjani closed 4 years ago

Shubhangvanjani commented 4 years ago

Issue I am using this package to upload image file and document file(pdf). For android its working perfectly and for ios i am able to copy image to app directory with copyPHImageToAppDirectory(rawData: PHAsset, fileName: any): Promise<{}> but for pdf file when trying these different methods it gives me an error

Code Snippet mediafilepicker.on("getFiles", async function (res) { let results = res.object.get('results'); console.log(">>>>>>>>>RESULTS>>", results) try{ let localStore = await mediafilepicker.copyMPMediaFileToAPPDirectory(results, name) }catch(err){ console.log("ERROR<<><>", err) } }

Error log CONSOLE LOG file:///app/bundle.js:1:233870: '>>>>>>>>>RESULTS>>' [ { type: 'normalFile', file: 'file:///private/var/mobile/Containers/Data/Application/F142712C-5B9A-4575-9A4B-86ECB30DA337/tmp/com.nativescript.salesforce-Inbox/test.pdf', rawData: {} }, [length]: 1 ]

[TypeError: e.valueForProperty is not a function. (In 'e.valueForProperty(MPMediaItemPropertyAssetURL)', 'e.valueForProperty' is undefined)]

jibon57 commented 4 years ago

Didn't follow template

erkanarslan commented 4 years ago

I have the same problem