Пример #1
0
 function do_uploadscrawl()
 {
     if ($_GET["action"] == "tmpImg") {
         // 背景上传
         iFS::$callback = false;
         $F = iFS::upload('upfile', 'scrawl/tmp');
         $F === false && exit;
         $F['path'] && ($url = iFS::fp($F['path'], '+http'));
         echo "<script>parent.ue_callback('" . $url . "','SUCCESS')</script>";
     } else {
         iFS::$callback = true;
         $F = iFS::base64ToFile($_POST['upfile'], 'scrawl/' . get_date(0, 'Y/md'));
         $F === false && exit(iFS::$ERROR);
         $F['path'] && ($url = iFS::fp($F['path'], '+http'));
         $tmp = iFS::get_dir() . "scrawl/tmp/";
         iFS::rmdir($tmp);
         iPHP::json(array("url" => $url, "state" => 'SUCCESS'));
     }
 }