This question is locked. New answers and comments are not allowed.
Hi,
have got a file system handle and can create a file on the root directory but am trying to create a subdirectory for my app where the files are stored. I use the command:
fileSystem.root.getDirectory("/lightning/attachments/",{create: true, exclusive: false}, function(dir){alert("Created dir "+dir.name);},function(error){alert("Error creating directory "+fileErrorCode(error.code));})
where fileErrorCode converts the code into a text sting as per the phonegap FileError code API.
I get back an error code of 12 which translates to "PATH_EXISTS_ERR"
Have tried adding the file system root to the path with the same result.
Lookin on the web I found a similar thing on google groups:
https://groups.google.com/forum/#!msg/phonegap/CUJO1qLZK0g/PgByaUEykoQJ
who recommends adding to config.xml:
I am testing on a Galaxy S3 & all the examples show writing and reading in the root directory (which works)
Probably my next post will be how to write and read to the subdirectory !!!
Any suggestions??
have got a file system handle and can create a file on the root directory but am trying to create a subdirectory for my app where the files are stored. I use the command:
fileSystem.root.getDirectory("/lightning/attachments/",{create: true, exclusive: false}, function(dir){alert("Created dir "+dir.name);},function(error){alert("Error creating directory "+fileErrorCode(error.code));})
where fileErrorCode converts the code into a text sting as per the phonegap FileError code API.
I get back an error code of 12 which translates to "PATH_EXISTS_ERR"
Have tried adding the file system root to the path with the same result.
Lookin on the web I found a similar thing on google groups:
https://groups.google.com/forum/#!msg/phonegap/CUJO1qLZK0g/PgByaUEykoQJ
who recommends adding to config.xml:
<feature name="http://api.phonegap.com/1.0/file "/> with the appropriate phonegap version of course.
but where do I add it (if this is the solution).
I can see from the Icenium xml for Android that the file plugin is included.I am testing on a Galaxy S3 & all the examples show writing and reading in the root directory (which works)
Probably my next post will be how to write and read to the subdirectory !!!
Any suggestions??