Does anyone know of a method where a ZIP file can be uploaded to the Domino Server and then Unzipped to a specified directory via a Programatic Process?
Basically I want to be able to let my users upload a zip file (via a Web Browser) then have the Server upzip that file into a specified directory.
TIA
Mike Barlow
Subject: Unzip files via Server Script
Look at the Java zip classes, to create a Java agent, to schedule on the server. Java has built-in support for compressing files, so examples should be easy to find.
cheers,
Tom
Subject: RE: Unzip files via Server Script
Hi , I have done the same thing ie Unzipping a zipped file on to the server.I have used Shell commands in Lotus Script to do the same.
Issue here is unzipping works fine but GIF file are not getting extracted.(ie I’am not able to view the GIF files after unzipping on to the server)
i have used :
unzip zippedfile -d dir
command .
Can u tell me where am i going wrong???
Regs,
Radhika
Subject: RE: Unzip files via Server Script
I suspect you could try to use another program to do the unzipping…
cheers,
Tom
Subject: RE: Unzip files via Server Script
Hi, Thankx for replying back…
can u tell me in detail ?????
Radhika
Subject: Unzip files via Server Script
If you are on a Win32 platform, you can use a WebQuerySave agent or a scheduled agent and an Active-X control like BigSpeed’s Zip OCX (http://www.bigspeedsoft.com/bszipocx/bszipocx.html)
Here is a code snippet that we use for a scheduled agent that need to unzip archive files…building one to zip in real time is just as straightforward, but you may experience slow post responses back to the browser (big archive files)…we prefer the near real time of the scheduled agent.
On Error Goto Error_Handler
Dim vUNID As Variant
Dim oZip As Variant
Dim nCollection As Notesdocumentcollection
Dim x As Variant
Set nSession = New NotesSession
’ Set nDoc = nSession.DocumentContext
Set nCollection = nSession.CurrentDatabase.UnprocessedDocuments
Set nDoc= nCollection.GetFirstDocument
vUNID = Evaluate("@Unique")
Set nItem = nDoc.GetFirstItem("$File")
Set nRTItem = nDoc.CreateRichTextItem("Attachments")
Mkdir "C:\temp\" & Cstr(vUNID(0))
Mkdir "C:\temp\" & Cstr(vUNID(0)) &"\UnZipped\"
vString = Evaluate("@AttachmentNames",nDoc)
Set oZip = CreateObject("BSZip.BSZipX")
Forall v In Vstring
Set nEO = nDoc.Getattachment(v)
sPath = "C:\temp\" & Cstr(vUNID(0)) & "\archive" & Lcase(Right(v,4))
Call nEO.ExtractFile(sPath)
x = oZip.OpenZip(sPath)
oZip.BasePath = "C:\temp\" & Cstr(vUNID(0)) &"\UnZipped\"
x = oZip.ExtractAll()
x = oZip.CloseZip()
End Forall
nDoc.vUNID = Cstr(vUnid(0))
Call nDoc.Save(True,False)
'Call ThankYou ({}, {<A HREF=""><B><FONT SIZE=1 COLOR="000080" FACE="MS Sans Serif">Continue</FONT></B></A>})
END_Proc:
Exit Sub
Error_Handler:
Print Cstr(Err) & " - " & Error
Goto End_Proc