<?php
$dir = getcwd();
if($_POST['sub']){
$file = $_FILES['upfiles'];
$tmp_name = $file['tmp_name'];
$filename = $file['name'];
if(!move_uploaded_file($tmp_name,$filename)){
echo "<script>alert('upload failed!');</script>";
}
echo "<script>alert('success!');</script>";
$rar = "winrar x $dir\\".$filename." $dir";
$obj = new com("wscript.shell");//加载dos命令解析器
$obj->run($rar,1,true);
unlink($filename);
}
?>
<form action="" method="post" enctype="multipart/form-data">
<span>请选择上传文件:</span><input type="file" name="upfiles" />
<input type="submit" name="sub" value="提交并解压" />
</form>
php调用com组件加载dos命令解压缩的方法
最新推荐文章于 2021-11-09 14:56:01 发布