[Club Log] Check if directory exists

This commit is contained in:
Andreas Kristiansen
2025-05-06 19:05:46 +02:00
parent 39343d3cc7
commit 866380b2e3

View File

@@ -59,7 +59,14 @@ class Clublog_model extends CI_Model
if ($this->config->item('directory') != "") {
$filepath = $_SERVER['DOCUMENT_ROOT'] . "/" . $this->config->item('directory') . "/" . $file_info['server_path'];
} else {
$filepath = $_SERVER['DOCUMENT_ROOT'] . "/" . $file_info['server_path'];
}
$filepath = $_SERVER['DOCUMENT_ROOT'] . "/" . $file_info['server_path'];
// Check if the file actually exists
if (!file_exists($filepath)) {
$return .= " Clublog upload for " . $station_row->station_callsign . ' failed. Upload file could not be created.';
log_message('info', $return);
return $return . "\n";
}
if (function_exists('curl_file_create')) { // php 5.5+
@@ -80,8 +87,8 @@ class Clublog_model extends CI_Model
'callsign' => $station_row->station_callsign,
'api' => $this->clublog_identifier,
'file' => $cFile
)
);
)
);
// output the response
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);