请大师们讲解一下这个重要问题
要达到,上传RAR或ZIP压缩包能自动在ggfile文件夹内解压缩并自动改文件夹名称为上传时的随机*****.zip的前缀。不知道怎么定好,请大师们改改。我写的程序现在只能解压缩,但是自动改不了文件夹名称为上传******.zip的前缀。
主要是下面红色部份,
<!--#include file="UpLoadClass.asp"-->
<%
dim nTime : nTime = Timer()
dim myrequest,lngUpSize
Set myrequest=new UpLoadClass
myrequest.MaxSize = 1005000*1024
myrequest.FileType = "txt/rar/zip/gif/jpg/bmp/swf/wma/wav/mp3/rm/rmvb/avi/exe/xls/xlsx/doc/docx/ppt/pptx"
myrequest.Savepath = "ggFile/"
lngUpSize = myrequest.Open()
dim strFile1 : strFile1=myrequest.Form("Photo")
dim intError : intError=myrequest.Form("photo_Err")
dim lngSize1 : lngSize1=0
filename11=left(strFile1,instrrev(strFile1,".")-1)
on error resume next
unzip_path=Server.mappath("ggFile")&"\"
Set WshShell = server.CreateObject("Wscript.Shell")
IsSuccess = WshShell.Run ("winrar x -r -o+ "&unzip_path&""&filename11&".zip "&unzip_path&"",1, False)
IsSuccess = WshShell.Run ("winrar x -r -o+ "&unzip_path&""&filename11&".rar "&unzip_path&"",1, False)
if IsSuccess = 0 Then
Response.write " 命令成功执行!" 'asp解压成功提示
else
Response.write " 命令执行失败!权限不够或者该程序无法运行" 'asp解压权限报错
end if
if err.number <> 0 then
Response.Write "<p>错误号码:" & Err.number 'asp解压报错
Response.Write "<p>原因:" & Err.description 'asp解压报错
Response.Write "<p>错误来源:" & Err.Source 'asp解压报错
Response.Write
end if
%>
<html>
<head>
<title>公告发送成功</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/css.css" type="text/css">
</head>
<body bgcolor="#DFEEFC" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
title=myrequest.form("title")
classify=myrequest.form("classify")
content=myrequest.form("content")
secretRB=myrequest.form("secretRB")
Degree=myrequest.form("Degree")
sendto=myrequest.form("sendto")
linkpath=myrequest.Form("Photo")
dim filename22,filename33
filename22=myrequest.Form("Photo_Name")
filename33=left(filename22,instrrev(filename22,".")-1)
Dim fso,f,folder
Set fso=Server.CreateObject("scripting.filesystemobject")
'改目录名
Set folder=fso.getfolder(Server.Mappath("ggFile/"&filename33&""))
folder.name="cc" '新名字