Change addAttachment function to obtain the full path of the attachments directory using the getcwd() function.

pull/4/head
Ben P 2021-12-31 12:44:45 -07:00
rodzic c505388f5f
commit eb53b99bc6
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -103,14 +103,14 @@ class DeckClass {
public function addAttachment($data) {
global $mailData;
global $cardId;
$fullPath = 'D:/projects/Deck API'; // /var/www/nextcloud/apps/mailtodeck
$fullPath = getcwd() . "/attachments/"; //get full path to attachments dirctory
for ($i = 1; $i < count($mailData->fileAttached); $i++) {
$data = array(
'file' => new CURLFile("$fullPath/attachments/" . $mailData->fileAttached[$i])
'file' => new CURLFile($fullPath . $mailData->fileAttached[$i])
);
$this->apiCall("", NC_SERVER . "/index.php/apps/deck/api/v1.0/boards/1/stacks/1/cards/$cardId/attachments?type=deck_file", $data);
}
}
}
?>
?>