API: new procedure 'removeAllFiles' and contract change for 'createFile'

This commit is contained in:
Frederic Guillot
2015-06-13 15:47:48 -04:00
parent 4161015023
commit 0b7435b882
12 changed files with 315 additions and 134 deletions

View File

@@ -38,3 +38,15 @@ if (! is_writable('data')) {
if (ini_get('arg_separator.output') === '&') {
ini_set('arg_separator.output', '&');
}
// Prepare folder for uploaded files
if (! is_dir(FILES_DIR)) {
if (! mkdir(FILES_DIR, 0755, true)) {
die('Unable to create the upload directory: "'.FILES_DIR.'"');
}
}
// Check permissions for files folder
if (! is_writable(FILES_DIR)) {
die('The directory "'.FILES_DIR.'" must be writeable by your webserver user');
}