Quote from
luishp on July 10, 2022, 10:04 am
And my last question is, how can I create a folder with variable name on host?
I have not included that option in neoPhp for security reasons. If you can create a folder directly from your script then anyone can.
I added permissions retrictions for reading and writing files to avoid security issues but regarding folders that's not as easy.
You can use file name subfixes or prefixes instead or call a custom .php script to create the folder. For example save this code as createfolder.php file:
<?php
$thePath = $_POST['thePath'];
if (!file_exists($thePath)) {
mkdir($thePath, 0777, true);
}
?>
Then you can call this PHP script from VisualNEO Web:
CreateEmptyObject [mydata]
SetVar [mydata.thePath] "path/to/directory"
neoAjaxSend "createfolder.php" "POST" "[mydata]" "json" "" ""
But, without user permission controls, this will allow anyone to create any folder on the server.
Regards.
And my last question is, how can I create a folder with variable name on host?
I have not included that option in neoPhp for security reasons. If you can create a folder directly from your script then anyone can.
I added permissions retrictions for reading and writing files to avoid security issues but regarding folders that's not as easy.
You can use file name subfixes or prefixes instead or call a custom .php script to create the folder. For example save this code as createfolder.php file:
<?php
$thePath = $_POST['thePath'];
if (!file_exists($thePath)) {
mkdir($thePath, 0777, true);
}
?>
Then you can call this PHP script from VisualNEO Web:
CreateEmptyObject [mydata]
SetVar [mydata.thePath] "path/to/directory"
neoAjaxSend "createfolder.php" "POST" "[mydata]" "json" "" ""
But, without user permission controls, this will allow anyone to create any folder on the server.
Regards.