on 2016 Apr 11 8:28 AM
HI,
Which API should I use in order to create/generate new file in the WebIDE ?
I've content which I want to put inside generated file.
my project is build like
myProj
folderA
fileA
FolderB
fileB
Lest assume that I need to create new html file inside folderA.
Which services I need to use ?
i've the
service.filesystem.documentProvider
I saw the service but not sure if it is the right service and how to use it inside my project for specific folder
oFolderDocument.importFile(new Blob([ my content])
Example will be very helpful
Message was edited by: Stephane Singler
Hi,
First you've to create a file by:
oFolderDocument.createFile(sFileName) which return a promise.
Now you have a new empty file and you can set the content of the file and save it.
Your code should look like:
oFolderDocument.createFile(sFileName).then(function(oFile){
return oFile.setContent(sContent).then(function(){
return oFile.save();
});
}).done();
HTH,
Lidor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
just Right click on folderA New->File give filename as <yourfilename>.<ext>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
12 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.