ASP can also extract the RAR file

Source: Internet
Author: User
Tags rar
Compression | Have you ever thought about extracting compressed files online? Oh, sometimes upload a compressed package, the use of ASP program decompression is indeed very convenient, especially the webmaster who often update the site, because the text file compression ratio is large, so the use of compression after the upload and then decompression, so more than direct upload to save a lot of valuable time. You ready? Let's keep it up.

In order to achieve this function, first of all to get a RAR program to extract the core file support (can download winrar software, and then the WinRar.exe file alone "take" out. And also requires a Cmd.exe program from the Windows operating system that is used to execute the WinRar.exe file. The operating system is self-contained, the NT kernel operating system can be found under the System32 folder under the operating system installation directory, and the Windows 9X operating system can be found under the System folder under the OS installation directory. ), as shown in Figure 1. Then upload them to the same directory. To create an ASP file, see the following code:

<%
Dim A,b,main,shell,runing,runcode,cmd,comm,fso
Main= "D:\chencheng\rar\" after uploading Winrar.exe and Cmd.exe after the path.
A=server.mappath ("rar") & "\" To extract RAR files after the storage path.
B=server.mappath ("Rar\homepage.rar") ' to extract the RAR file, which Homepage.rar modified to need to extract the file.
Set Shell = Server.CreateObject ("Wscript.Shell")
runing= "d:\chencheng\rar\cmd.exe/c" &Main& "Winrar.exe x-t-o+-p-" sets the command to run the decompression.
cmd=run&b& "" &a
RunCode = Shell.run (cmd,1, True)
%>




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.