Important! A new Community experience launched on September 26, 2017. Read more about it here or continue to Base Camp.
Vote up!
0 Votes
1 Replies

File creation issue - Studio 6.5

Magesh Rathnam on Apr 04, 2017 11:29 EDT

Posted In
Kony Answered Certificate
Vote up!
0 votes
Vote down!

Hi Magesh,

Below is the code to create file in the file system,

var path =;                                                                                                            //create the file in directory photos                                                                                                                                           var myfile = + "/photos/" + lMediaName + ".jpg");                                                                           var filecreated = myfile.createFile();

Where in case of Windows and Android if the given directory is not availabel then system will create the directory and will write the file. where in case of iOS if the directory is not avaialble it will return false.

To make if work in iOS

Please add the below code snippet before

var myfile = + "/photos/" + lMediaName + ".jpg");"

var myDirectory = + "/photos/");
var directorycreated = myDirectory.createDirectory();

As in case of iPhone, file won't be created if directory does not exist.



Apr 06, 2017 00:41 EDT