Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create nested directory in a single command #5

Open
erinddollaku opened this issue Jun 13, 2017 · 0 comments
Open

How to create nested directory in a single command #5

erinddollaku opened this issue Jun 13, 2017 · 0 comments

Comments

@erinddollaku
Copy link

erinddollaku commented Jun 13, 2017

How can i create nested directories?

Already tried:

	var folder = 'path/to/new/folder/ne/na/www';
	var newfold;
	var splitedVal = folder.split('/');

	function cret(val){
		ftprocss.createFolder("/web/"+val,{
			success:function(status){
				// see the object info
				//alert(JSON.stringify(status));

				if(status.created){
					//alert("Folder created");
				}
			},
			error:function(er){
				console.error(JSON.stringify(er));
			}
		});
	}

	for(var i=0;i<splitedVal.length;i++){
		if(i == 0){
			newfold = splitedVal[i];
			//alert(newfold);
			cret(newfold);
		}
		else{
			newfold = newfold + '/' + splitedVal[i];
			//alert(newfold);
			cret(newfold);
		}
	}

but it only creates the 2 first levels of directories. Any Idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant