fixed directory location
This commit is contained in:
parent
26fb9b54b6
commit
92e162283e
@ -224,7 +224,7 @@ class NotesModel extends Database
|
|||||||
$pdo = $this->linkDB();
|
$pdo = $this->linkDB();
|
||||||
if (!$pdo) return ['success' => false, 'message' => 'Database error.'];
|
if (!$pdo) return ['success' => false, 'message' => 'Database error.'];
|
||||||
|
|
||||||
$uploadDir = $_SERVER['DOCUMENT_ROOT'] . '/EIANotesApp/Uploads/';
|
$uploadDir = __DIR__ . '/../Uploads/';
|
||||||
$uploadedFileNames = [];
|
$uploadedFileNames = [];
|
||||||
|
|
||||||
if (!file_exists($uploadDir)) {
|
if (!file_exists($uploadDir)) {
|
||||||
@ -269,7 +269,7 @@ class NotesModel extends Database
|
|||||||
$stmt->execute([$fileId]);
|
$stmt->execute([$fileId]);
|
||||||
$file = $stmt->fetch();
|
$file = $stmt->fetch();
|
||||||
if ($file) {
|
if ($file) {
|
||||||
$filePath = $_SERVER['DOCUMENT_ROOT'] . '/EIANotesApp/Uploads/' . $file['stored_filename'];
|
$filePath = __DIR__ . '/../Uploads/' . $file['stored_filename'];
|
||||||
if (file_exists($filePath)) {
|
if (file_exists($filePath)) {
|
||||||
unlink($filePath);
|
unlink($filePath);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ include dirname(__DIR__).'/header.phtml';
|
|||||||
|
|
||||||
//// Test write permissions
|
//// Test write permissions
|
||||||
//// This is the directory we will upload files to.
|
//// This is the directory we will upload files to.
|
||||||
//$uploadDir = $_SERVER['DOCUMENT_ROOT'] . '/EIANotesApp/Uploads/';
|
//$uploadDir = __DIR__ . '/../Uploads/';
|
||||||
//if (!file_exists($uploadDir)) {
|
//if (!file_exists($uploadDir)) {
|
||||||
// mkdir($uploadDir, 0777, true);
|
// mkdir($uploadDir, 0777, true);
|
||||||
//}
|
//}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user