%@ Language=VBScript %> <% ' Abbrevia Example ' Copyright (c) 1999 TurboPower Software Company ' This Active Server Page is ' for use with Microsoft Internet Information Server Response.Buffer = True %> <% On Error Resume Next ' Archive Extraction and Download Example ' ' To use this example, follow these simple steps: ' ' 1. Replace the LicenseKey constant with a valid key. ' 2. Have a .ZIP file on the web site that can be opened. If the ZipKit is unable to open ' the file, first check to make sure it does not have the "read-only" attribute set. ' ' An example ZIP file called TEST.ZIP is included in the \abbrvia\com\examples\asp directory. const LicenseKey = "xxxxxxxx" %> <% BaseVDirectoryPath = Mid(Request.ServerVariables("PATH_INFO"), 1, InStrRev(Request.ServerVariables("PATH_INFO"), "/")) '* create location for zip files * ' - Create Directory based on DATE ' - Create file name based on TIME and IP address if (Request("Submit") = "Create Archive") then ZipKit.License(LicenseKey) ' You can come up with any filename naming method you. The one listed below will create a unique ' filename in most cases. ' FileName = Hour(Now) & Minute(Now) & Second(Now) & "-" & _ Replace(Request.ServerVariables("REMOTE_ADDR"), ".", "") ZipKit.BaseDirectory = Server.MapPath(BaseVDirectoryPath & "files/") ZipKit.FileName = Server.MapPath(BaseVDirectoryPath & FileName & ".ZIP") for each item in Request("ProductResource") ZipKit.Add(Mid(Server.MapPath(item), Len(ZipKit.BaseDirectory)+2)) next ZipKit.Save ' Either send the file directly to the browser Response.Redirect FileName & ".ZIP" ' OR ' Place a link on the page so the user can download it. 'Response.Write "Download your file Here." Response.End end if %>