|
|
@@ -99,7 +99,7 @@ class Attachment {
|
|
|
}
|
|
|
|
|
|
public function uploadFile($file, $item_id, $file_type) {
|
|
|
- $uploadDir = '/var/www/html/attachments/';
|
|
|
+ $uploadDir = '/var/www/html/uploads/';
|
|
|
$allowedTypes = [
|
|
|
'application/pdf',
|
|
|
'image/jpeg',
|
|
|
@@ -139,7 +139,7 @@ class Attachment {
|
|
|
if ($this->create()) {
|
|
|
$baseUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
|
|
|
$apiPath = dirname($_SERVER['PHP_SELF']);
|
|
|
- $fullUrl = $baseUrl . '/attachments/' . $uniqueFileName;
|
|
|
+ $fullUrl = $baseUrl . '/uploads/' . $uniqueFileName;
|
|
|
|
|
|
return ['success' => true, 'url' => $fullUrl, 'id' => $this->conn->lastInsertId()];
|
|
|
} else {
|