Friends give me a support for ASP space, but upload files can only be a single file upload, no batch upload, my page has a lot of
Small pictures, this way of uploading is very painful. So consider the picture file can be compressed into a RAR format, and then on the server solution
Pressure.
In fact, want to achieve this function is very simple, first of all to upload a RAR decompression program, is RAR own decompression program, only need its core
Program RAR.EXE this file is OK. Then you will upload a program that executes RAR.EXE CMD. EXE This is a program in Windows (don't need me to say it). Finally, we started to implement these procedures. Take a look at the following code
<%
Dim Ylj,ywj,mlpath,shell,rarcomm,retcode,cmd,comm,fso
Mlpath= "E:pagemian" to store RAR.EXE and CMD.EXE paths
Ylj=server.mappath ("Mian") & "'" ' the path after extracting the file
Ywj=server.mappath ("Mianapathy.rar") ' RAR file to extract
Set Shell = Server.CreateObject ("Wscript.Shell")
Rarcomm= "e:pagemiancmd.exe/c" &Mlpath& "Rar.exe x-t-o+-p-"
cmd=rarcomm&ywj& "" &ylj
RetCode = Shell.run (cmd,1, True)
%>
is to use Server.CreateObject ("Wscript.Shell") to perform CMD.EXE to run RAR.EXE files to extract RAR files.
I didn't know if any of the predecessors had published these articles, but the brother is interested in using this method to achieve many similar and such procedures, I hope you can find some better ways.
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.