virt2/api/soft/tinymce/4.3.12/plugins/image/upload.php

31 lines
770 B
PHP
Raw Normal View History

<?php
require_once('config.php');
require_once('functions.php');
//echo LIBRARY_FOLDER_PATH;
if(!defined('LIBRARY_FOLDER_PATH')){
// define('LIBRARY_FOLDER_PATH', 'uploads/');
}
/*
if(!defined('LIBRARY_FOLDER_PATH')){
$pageURL = 'http';
if(isset($_SERVER["HTTPS"]) AND $_SERVER["HTTPS"] == "on"){
$pageURL .= "s";
}
$pageURL .= "://";
if($_SERVER["SERVER_PORT"] != "80"){
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}else{
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
if(preg_match("/(.*)\/upload\.php/",$pageURL,$matches)){
define('LIBRARY_FOLDER_URL', $matches[1] . '/uploads/');
}
}
*/
$output = DoUpload('upl');
header("Content-type: text/plain;");
echo json_encode($output);
exit();