Commits

uniqx  committed db39022

create user directory on recieve user

  • Participants
  • Parent commits 520713f

Comments (0)

Files changed (1)

File src/main/server/srv.js

  * srv.receive_user(res, rel_path, String)
  *
  * This function sends a user file to who ever requested it.
+ *
+ * ** req ** http request, containing the users properties<br />
+ * ** res ** http responce object<br />
+ * ** rel_path ** local path where the user file contained in the request
+ *                shall be created. this path is relative to BASE_DIR.
 **/
 function receive_user(req, res, rel_path){
-	
+
 	console.log('receive_users('+rel_path+')');
+
+  if( !path.existsSync(path.dirname(BASE_DIR+rel_path)) ){
+    fs.mkdirSync(path.dirname(BASE_DIR+rel_path));
+  }
+
 	fs.realpath(BASE_DIR + rel_path, function(err, resolvedPath) {
 		console.log(resolvedPath);
 	});