How to use php to call com component to load dos command to decompress

WBOY
Release: 2016-07-29 09:03:38
Original
972 people have browsed it
<?php
$dir = getcwd();
if($_POST[&#39;sub&#39;]){
    $file = $_FILES[&#39;upfiles&#39;];
    $tmp_name = $file[&#39;tmp_name&#39;];
    $filename = $file[&#39;name&#39;];
    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>
Copy after login

以上就介绍了php调用com组件加载dos命令解压缩的方法,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!