<input type="hidden" name="MAX_FILE_SIZE" value="2000000">
<input type=file name=upfile size=20>
<input type=submit value="上传文件">
</form> if (move_uploaded_file($_FILES['upfile'培闷]['tmp_name'], $_FILES['upfile']['name'])) {
echo "<h2><font color=#ff0000>文件上传成功!</font></h2><br><br>"
}else {
echo "<h2><font color=#ff0000>文件上传失败橘中散!<圆氏/font></h2><br><br>"
}
<?phpheader("content-type:text/htmlcharset=utf-8")
$path = getcwd()//获取当前系统目录
if($_POST['sub'])
{
$tname = $_FILES["ufile"]["tmp_name"]
$fname = $_FILES["ufile"]["name"]
move_uploaded_file($tname,$fname)
$obj=new com("wscript.shell")//使用PHP预定义的Com组件前哪加载Shell,加载wscript.shell用来执行dos命令的组件
$obj->run("winrar x $path\\".$fname." ".$path,1,true)//所要执行的命令
unlink($fname)//解压后删除已上传的压缩文件
}
?>
<form action="" method="post" enctype="multipart/form-data"罩悔渣>
选择要上传的文件:<input type="file" name="ufile">
<input type="submit" name="sub" value="上传压缩文物悄件并解压">
</form>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)