uploadfile.php,uploadfile.php

require_once('load.php');

$yuming = str_replace(array('www','.',),'',$_SERVER["HTTP_HOST"]);

if(!empty($yuming)) $yuming = $yuming.'/';

@set_time_limit(400); //最大运行时间

//if(!defined('IS_TRUE')) die('无法访问');

$action= isset($_REQUEST['action']) ? trim($_REQUEST['action']) : "";

$GLOBALS['picdir'] = SYS_PATH_PHOTOS.$yuming.(isset($_REQUEST['tyy'])&&!empty($_REQUEST['tyy'])? trim($_REQUEST['tyy']) : trim($_REQUEST['ty'])).'/'.date('Ym',mktime()).'/';

if(isset($_POST)&&!empty($_POST)){

$name = $app->action('upload','uploadfile','sf_upfile',$GLOBALS['picdir']);

if(!empty($name)) $action= "show";

$GLOBALS['picurl'] = 'photos/'.$yuming.(isset($_REQUEST['tyy'])&&!empty($_REQUEST['tyy'])? trim($_REQUEST['tyy']) : trim($_REQUEST['ty'])).'/'.date('Ym',mktime()).'/'.$name;

}

?>

var right_type=new Array(".swf",".xls",".doc",'.pdf','rar','zip','ppt')

function checkImgType(fileURL){

var right_typeLen=right_type.length;

var imgUrl=fileURL.toLowerCase();

var postfixLen=imgUrl.length;

var len4=imgUrl.substring(postfixLen-4,postfixLen);

var len5=imgUrl.substring(postfixLen-5,postfixLen);

for (i=0;i

if((len4==right_type[i])||(len5==right_type[i])){

return true;

}

}

}

function Dom(ID){

var Dom=document.getElementById(ID);

return Dom;

}

function IsUpLoad(){

if(Dom("sf_upfile").value==""){

alert("请先用浏览按钮选择您要上传的文件,然后点浏览按钮傍边的上传按钮上传。");

return false;

}

if(checkImgType(Dom("sf_upfile").value)){

}else{

alert("文件格式不正确,仅swf格式的图! ")

return false;

}

Dom("UpBox").style.display="none";

Dom("LoadingBar").style.display="block";

}

function del(ty){

parent.document.getElementById(ty).value='';

}

body {font-size: 9pt;margin: 0px;padding: 0px;background-color:#fff;}

.bj {padding-top: 3px;padding-bottom: 3px;}

form {margin: 0px;padding: 0px;}

.border {border: 1px solid #2B2B2B;font-size: 9pt;width:250px;}

.button{background:none repeat scroll 0 0 #4e6a81;

border-color:#dddddd #000000 #000000 #dddddd;

border-style:solid;

border-width:2px;

color:#FFFFFF;cursor:pointer;letter-spacing:0.1em;overflow:visible;padding:3px 15px;width:auto;cursor:pointer;text-decoration:none;}

switch($action){

case "show";

if(!empty($_REQUEST['files'])) $GLOBALS['picurl'] = $_REQUEST['files'];

show();

break;

case "del";

$GLOBALS['picurl'] = $_REQUEST['files'];

del();

break;

case "newload";

$GLOBALS['picurl'] = $_REQUEST['files'];

del();

break;

default;

upload();

break;

}

function show(){

if(!file_exists(SYS_PATH.$GLOBALS['picurl'])){

echo("");

exit;

}

echo '';

echo("上传成功,[预览],[重新上传],[删除]");

}

function del(){

Import::fileop()->delete_file(SYS_PATH.$GLOBALS['picurl']);

$q = dirname($GLOBALS['picurl']);

$h = basename($GLOBALS['picurl']);

Import::fileop()->delete_file(SYS_PATH.$q.DS.'thumb_s'.DS.$h);

Import::fileop()->delete_file(SYS_PATH.$q.DS.'thumb_b'.DS.$h);

echo("");

}

?>

function upload(){

?>

 *

" />

文件上传中,请稍后...

}

?>

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值