seankillilea
Newbie
Posts: 1
Registered: 10/16/2005
Member Is Offline
|
| posted on 10/16/2005 at 08:10 PM |
|
|
How 2 easiest
I want to unzip a file by looping through it, like this
for each file in zip (not sure how to iterate the zip file)
if file.ext inst(...) then (??)
1) allow to unzip
2) insert into db (got this covered)
end if
next
need to delete the zip file (??)
need to delete the temp folder it creates (?)
thanks
|
|
|
wit
Member
Posts: 24
Registered: 11/19/2004
Member Is Offline
|
| posted on 7/2/2006 at 04:03 AM |
|
|
See the example below:
ZipFileName = Server.MapPath("/temp/test.zip") 'Get loacation of your zip file
UnzipPath = Server.MapPath("/temp") 'Get destination path
Set Zip = CreateObject("SoftComplex.Zip")
Zip.Open ZipFileName
Zip.Read 'Read zip file content
for I = 0 To Zip.Count - 1
if InStr(Zip.FileName, ".exe") > 0 then
Zip.Selected[I] = True 'Select file to be extracted
PostSomeThingToDatabase Zip.FileFullName
End If
Next
if Zip.SelectedCount > 0 then 'If any file selected then extract
Zip.DestDirectory = UnzipPath 'Set destination path
FileCount = Zip.UnzipSelected 'Unzip selected files
End If
|
|
|