<script language="VBScript.Encode" runat=server>
'上面用SHELL对象启动程序
Set WshShell = server.CreateObject("Wscript.Shell")
IsSuccess = WshShell.Run ("E:/wwwroot/TempProductPic/TempUpFile/wzzip.exe E:/wwwroot/TempProductPic/TempUpFile/TempUpFile.zip E:/wwwroot/TempProductPic/TempUpFile/20043/" ,1, true)
if IsSuccess = 0 Then
'Response.write " 命令成功执行!"
Call DownFile("E:/wwwroot/TempProductPic/TempUpFile/TempUpFile.zip","TempProductPic.zip")
else
Response.write "下载文件失败或没有图片可供下载!!!"
end if
Sub DownFile(DlFile,FileName)'dlfile为要下载的文件名,filename为下载时的文件名。
Set Fso1 = Server.CreateObject("Scripting.FileSystemObject")
If Fso1.FileExists(DlFile) Then
Set S=server.CreateObject("Adodb.Stream")
S.Mode=3
S.Type=1
S.Open
'S.LoadFromFile(server.mappath(dlfile))
S.LoadFromFile(DlFile)
Response.AddHeader "Content-Disposition", "attachment; filename="&FileName
Response.CharSet = "GB2312"
Response.ContentType = "application/unknow"
Response.BinaryWrite(S.Read)
Response.Flush
s.close
set s=nothing
Call DelFile("E:/wwwroot/TempProductPic/TempUpFile/TempUpFile.zip")
Else
Response.Write "当前没有图片可供下载!!"
End If
Set Fso1 = Nothing
End Sub
Sub DelFile(FilePath)
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
'FilePath = Server.MapPath(delRs(0)&delRs(1))
If Fso.FileExists(FilePath) Then
Fso.DeleteFile FilePath,True'如果存在该文件则删除
End If
Set Fso = Nothing'清除FSO对像
End Sub
Set WshShell = Nothing
</script>
'上面用SHELL对象启动程序
Set WshShell = server.CreateObject("Wscript.Shell")
IsSuccess = WshShell.Run ("E:/wwwroot/TempProductPic/TempUpFile/wzzip.exe E:/wwwroot/TempProductPic/TempUpFile/TempUpFile.zip E:/wwwroot/TempProductPic/TempUpFile/20043/" ,1, true)
if IsSuccess = 0 Then
'Response.write " 命令成功执行!"
Call DownFile("E:/wwwroot/TempProductPic/TempUpFile/TempUpFile.zip","TempProductPic.zip")
else
Response.write "下载文件失败或没有图片可供下载!!!"
end if
Sub DownFile(DlFile,FileName)'dlfile为要下载的文件名,filename为下载时的文件名。
Set Fso1 = Server.CreateObject("Scripting.FileSystemObject")
If Fso1.FileExists(DlFile) Then
Set S=server.CreateObject("Adodb.Stream")
S.Mode=3
S.Type=1
S.Open
'S.LoadFromFile(server.mappath(dlfile))
S.LoadFromFile(DlFile)
Response.AddHeader "Content-Disposition", "attachment; filename="&FileName
Response.CharSet = "GB2312"
Response.ContentType = "application/unknow"
Response.BinaryWrite(S.Read)
Response.Flush
s.close
set s=nothing
Call DelFile("E:/wwwroot/TempProductPic/TempUpFile/TempUpFile.zip")
Else
Response.Write "当前没有图片可供下载!!"
End If
Set Fso1 = Nothing
End Sub
Sub DelFile(FilePath)
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
'FilePath = Server.MapPath(delRs(0)&delRs(1))
If Fso.FileExists(FilePath) Then
Fso.DeleteFile FilePath,True'如果存在该文件则删除
End If
Set Fso = Nothing'清除FSO对像
End Sub
Set WshShell = Nothing
</script>