kopia lustrzana https://github.com/newroco/mail2deck
Change addAttachment function to obtain the full path of the attachments directory using the getcwd() function.
rodzic
c505388f5f
commit
eb53b99bc6
|
@ -103,14 +103,14 @@ class DeckClass {
|
||||||
public function addAttachment($data) {
|
public function addAttachment($data) {
|
||||||
global $mailData;
|
global $mailData;
|
||||||
global $cardId;
|
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++) {
|
for ($i = 1; $i < count($mailData->fileAttached); $i++) {
|
||||||
$data = array(
|
$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);
|
$this->apiCall("", NC_SERVER . "/index.php/apps/deck/api/v1.0/boards/1/stacks/1/cards/$cardId/attachments?type=deck_file", $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Ładowanie…
Reference in New Issue