mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
[Club Log] Check if directory exists
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user