- rename($fqfn, substr($fqfn, 1));
- echo 'File has been made visible';
+ $targetFile = $data['uploaddir'] . DIRECTORY_SEPARATOR . substr($file, 1);
+ $successMessage = 'File has been made public';
+ $failedMessage = 'File has NOT been made public';
+ } else {
+ $targetFile = $data['uploaddir'] . DIRECTORY_SEPARATOR . '.' . $file;
+ $successMessage = 'File has been hidden';
+ $failedMessage = 'File has NOT been hidden';
+ }
+ if (rename($sourceFile, $targetFile)) {
+ echo $successMessage;