<?php
    defined('IN_TS') or die('Access Denied.');
    
    
    if($ts=='')
    {
        echo "gun!";
        exit;
        
    }
    $userid = aac('user')->isLogin();
    $ts=tsFilter($ts);
    $url=str_replace("/uploadfile/editor/","",$ts);
    if($url=='')
    {
        echo "erro";
        exit;
        
    }
    $the_file=$new['pubs']->find('editor',array(
                                                'url'=>$url,
                                                
                                                ));
    if($the_file)
    {
        echo $the_file['id'];
    }else
    {
        echo "-1";
        
    }
    
    /*
     $file_name = "187.doc";
     $file_dir = "uploadfile/editor/0/0/";
     if (!file_exists($file_dir . $file_name)) { //检查文件是否存在
     echo "文件已删除";
     exit;
     }else{
     
     $file = fopen($file_dir . $file_name,"r"); // 打开文件
     // 输入文件标签
     Header("Content-type: application/octet-stream");
     Header("Accept-Ranges: bytes");
     Header("Accept-Length: ".filesize($file_dir . $file_name));
     Header("Content-Disposition: attachment; filename=" . $file_name);
     // 输出文件内容
     echo fread($file,filesize($file_dir . $file_name));
     fclose($file);
     exit;
     
     }
     */
    
    ?>

