Remove certain files in a zip file


Remove certain files in a zip file

Postby fpuerto on Fri Jun 03, 2005 9:13 am

Hello,
I create a zip file with all files in a folder (*.*). After, I need remove a file is called leeme.txt and a htm file.
I have tested use removeZip method after to use zip method but the component don`t remove the specified files.

Anybody know how I can remove the files?

Thanks

Juan Saúl Pastor
fpuerto
 
Posts: 8
Joined: Wed Jun 01, 2005 9:41 am

Postby John on Fri Jun 03, 2005 9:53 am

The RemoveZip is just a feature for registered users. Is not included on the freeware version.
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain

Postby fpuerto on Fri Jun 03, 2005 10:17 am

I am a registered user
fpuerto
 
Posts: 8
Joined: Wed Jun 01, 2005 9:41 am

Postby John on Fri Jun 03, 2005 10:24 am

Ok. Then set the debug property to true to see what's happening.

Remember that RemoveZIP does not use wildcards, you need to specify the full path.
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain

Postby fpuerto on Fri Jun 03, 2005 11:50 am

I set debug but the component don´t use removezip method, why?
fpuerto
 
Posts: 8
Joined: Wed Jun 01, 2005 9:41 am

Postby John on Fri Jun 03, 2005 12:02 pm

Can you post your sample so we can see what could be wrong?
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain

Postby fpuerto on Fri Jun 03, 2005 12:28 pm

' Create the object
set objZIP = Server.CreateObject("aspZip.EasyZIP")

' Debug, show what's going on
'objZIP.Debug = True

const AddDirNames = 1
'const AddRecurseDirs = 4

objZIP.ZipFileName = Server.MapPath ("/docs/temp/zip/456.zip")
ZipFileName = objZIP.ZipFileName
objZIP.ArgsClear
objZIP.AddOptions = AddDirNames
objZIP.ArgsAdd (rutaPDF & "\*.*")
objZIP.ArgsAdd (rutaLEEME)
objZIP.ZIP
objZip.RemoveZip (Identificador & Secuencia & "--.HTM")
objZip.RemoveZip ("LEEME1.PDF")
fpuerto
 
Posts: 8
Joined: Wed Jun 01, 2005 9:41 am

Postby John on Fri Jun 03, 2005 12:37 pm

Try to change it;

objZIP.ZIP
set objZIP = nothing

' Re create the object
set objZIP = Server.CreateObject("aspZip.EasyZIP")
objZIP.ZipFileName = Server.MapPath ("/docs/temp/zip/456.zip")
'objZIP.Debug = True
objZip.RemoveZip (Identificador & Secuencia & "--.HTM")
objZip.RemoveZip ("LEEME1.PDF")

Make sure the files you are trying to delete are in the root of the ZIP file, because I saw you are using the AddDirNames and the files may be at different place. Remember that removing a file needs full path to be deleted.
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain

Postby fpuerto on Fri Jun 03, 2005 1:58 pm

Ya lo he solucionado con el método ArgsExc.

Gracias
Last edited by fpuerto on Fri Jun 03, 2005 2:07 pm, edited 1 time in total.
fpuerto
 
Posts: 8
Joined: Wed Jun 01, 2005 9:41 am

Postby John on Fri Jun 03, 2005 2:06 pm

envianos a support@mitdata.net el fichero ZIP y te diremos exactamente el parametro que tienes que utilizar
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain

Postby John on Fri Jun 03, 2005 2:07 pm

Perdon, ahora me he fijado que tienes mal el método;

Zip.ZipFileName = Server.MapPath ("/docs/temp/zip/456.zip")
Zip.ArgsClear
Zip.ArgsAdd(ruta & "\" & Identificador & Secuencia & "--.HTM")
Zip.RemoveZip
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain


Return to Zip

Who is online

Users browsing this forum: No registered users and 2 guests

cron

Fatal error: Not able to open ./cache/data_global.php in D:\Hosting\6480136\html\ForosBB3\includes\acm\acm_file.php on line 106