20
Views
3
Comments
File pludgin not create directory
Question

im using outsystem service studio 11 to build android mobile. im still new in outsystem, i try using file pludgin to create directory on mobile (see attachment). when i try to run i got eror : cannot read property 'getDirectory' of null. how do I fix it ?

Capture2.PNG

Rank: #239

Hi Deddy,

There is already fileplugin sample component on forge,Please go through. Hope it will help you.

Regards,

Koushik



Rank: #116

Hi,

You have provided wrong path. You need to provide without file:///, the plugin has hard coded to create directory inside cordova.file.externalDataDirectory (look https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/#ios-file-system-layout for more details) for external, which will translate to Android/data/<app-id>/files in android.

Check this post https://stackoverflow.com/questions/18826517/how-to-create-subfolder-using-cordova which has a sample of how you can create a folder using cordova, you can add the script in one of the javascript node in client action. you need to have file plugin as reference in you app.

Regards.