Слияние кода завершено, страница обновится автоматически
<?php
require_once(dirname(__FILE__)."/"."global.php");
require(PHP168_PATH.'/JYAPI.php');
error_reporting(7);
//header('Content-Type: text/html; charset=utf-8');
if($fileData){
if(!$lfjid){
// showerr("你还没登录",1);
}
//其中..与/开头都是不允许的
if( !ereg("^[0-9a-z_/]+$",$dir)||ereg("^/",$dir) ){
$dir="other";
}
$updir='upload_files';
$path="$updir/$dir";
$array[name]=is_array($fileData)?$_FILES[fileData][name]:$fileData_name;
//require_once(PHP168_PATH."inc/class.chinese.php");
//$cnvert = new Chinese("UTF8","GB2312",$array[name],PHP168_PATH."./inc/gbkcode/");
//$array[name] = $cnvert->ConvertIT();
$array[path]=$webdb[updir]."/".$path;
$array[size]=is_array($fileData)?$_FILES[fileData][size]:$fileData_size;
$array[updateTable]=1; //统计用户上传的文件占用空间大小
$filename=upfile(is_array($fileData)?$_FILES[fileData][tmp_name]:$fileData,$array);
//echo $filename;
//exit;
$newfile2="$webdb[www_url]/$webdb[updir]/$dir/$filename";
// 这里开始将文件上传到91160:1.上传临时文件,2.上传新文件,3.获取上传后的文件路径返回
$file_upload_path = PHP168_PATH."$webdb[updir]/$dir/$filename";
echo $file_upload_path;
//exit;
$ext = strtolower( pathinfo($file_upload_path, PATHINFO_EXTENSION) );
$fileObj = new JYAPI('File');
$tmp_file = $fileObj->send($file_upload_path);
if( false == $tmp_file ){
die("文件上传远程服务器错误");
}
if( "jpg" == $ext or "jpeg" == $ext or "gif" == $ext or "png" == $ext ){
$entryObj = new JYAPI("Model_ResPic");
}else{
$entryObj = new JYAPI("Model_ResFile");
}
$send_info = array(
"belongs_to" => $_GET["belongs_to"],
"belongs_to_id" => $_GET["belongs_to_id"],
"res_type_id" => 0,
"title" => "upload-".time()
);
$newId = $entryObj->newOne($send_info,$tmp_file);
$newRemoteFile = $entryObj->getOne($newId);
$newfile = UPLOADPATH.$newRemoteFile["store_upload_url"];
//插入数据,关闭层
echo '<html>';
echo '<head>';
echo '<title>Insert Image</title>';
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
echo '</head>';
echo '<body>';
if(!$_GET[Ctype])
{
echo "<SCRIPT LANGUAGE=\"JavaScript\">parent.KindInsertImage('$newfile','$imgWidth','$imgHeight','$imgBorder','$imgTitle','$imgAlign','$imgHspace','$imgVspace')</SCRIPT>";
}
else
{
echo "<SCRIPT LANGUAGE=\"JavaScript\">parent.KindInsertImageP8FLV('$newfile','$imgWidth','$imgHeight','$_GET[Ctype]')</SCRIPT>";
}
echo '</body>';
echo '</html>';
exit;
}
//提示,关闭层
function alert($msg)
{
echo '<html>';
echo '<head>';
echo '<title>error</title>';
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
echo '</head>';
echo '<body>';
echo '<script type="text/javascript">alert("'.$msg.'");parent.KindDisableMenu();parent.KindReloadIframe();</script>';
echo '</body>';
echo '</html>';
exit;
}
?>
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )