Fixes directory to file issue, within config.php you must state your directory if its not in the main dir.
这个提交包含在:
父节点
f28d1686a1
当前提交
f5efb96392
共有 1 个文件被更改,包括 12 次插入 和 3 次删除
|
|
@ -8,11 +8,12 @@ class Clublog extends CI_Controller {
|
||||||
|
|
||||||
// Show frontend if there is one
|
// Show frontend if there is one
|
||||||
public function index() {
|
public function index() {
|
||||||
|
$this->config->load('config');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upload ADIF to Clublog
|
// Upload ADIF to Clublog
|
||||||
public function upload($username) {
|
public function upload($username) {
|
||||||
|
$this->config->load('config');
|
||||||
ini_set('memory_limit', '-1');
|
ini_set('memory_limit', '-1');
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
ini_set('display_startup_errors', 1);
|
ini_set('display_startup_errors', 1);
|
||||||
|
|
@ -48,10 +49,18 @@ class Clublog extends CI_Controller {
|
||||||
// initialise the curl request
|
// initialise the curl request
|
||||||
$request = curl_init('https://clublog.org/putlogs.php');
|
$request = curl_init('https://clublog.org/putlogs.php');
|
||||||
|
|
||||||
|
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'];
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $filepath; exit;
|
||||||
|
|
||||||
if (function_exists('curl_file_create')) { // php 5.5+
|
if (function_exists('curl_file_create')) { // php 5.5+
|
||||||
$cFile = curl_file_create($_SERVER['DOCUMENT_ROOT']."/".$file_info['server_path']);
|
$cFile = curl_file_create($filepath);
|
||||||
} else { //
|
} else { //
|
||||||
$cFile = '@' . realpath($_SERVER['DOCUMENT_ROOT']."/".$file_info['server_path']);
|
$cFile = '@' . realpath($filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// send a file
|
// send a file
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用