function do_IO() { $udir = iS::escapeStr($_GET['udir']); $name = iS::escapeStr($_GET['name']); $ext = iS::escapeStr($_GET['ext']); iFS::check_ext($ext, 0) or iPHP::json(array('state' => 'ERROR', 'msg' => '不允许的文件类型')); iFS::$callback = true; $_GET['watermark'] or iFS::$watermark = false; $F = iFS::IO($name, $udir, $ext); $F === false && iPHP::json(iFS::$ERROR); iPHP::json(array("value" => $F["path"], "url" => iFS::fp($F['path'], '+http'), "fid" => $F["fid"], "fileType" => $F["ext"], "image" => in_array($F["ext"], array('gif', 'jpg', 'jpeg', 'png')) ? 1 : 0, "original" => $F["oname"], "state" => $F['code'] ? 'SUCCESS' : $F['state'])); }