PDA

View Full Version : on the fly zipping


nvysel24
04-20-2010, 05:06 PM
Im trying to use 7zip that does "on the fly zipping"
A little background, I take a user input it then writes a file in a folder, then 7zip zips that folder and returns the zipped file in a link for the user to download.

what im having trouble with is i guess the syntax it gives me this error

error '80070002'

/testing_enviro/zipfiles2.asp, line 5

i researched this error and it says that it cant find what ever im trying to reference.

this below is the code

<%
response.write "hello"
set shell = CreateObject("WScript.Shell")
zipCommand = server.mappath("\testing_enviro\") & "7za a -tzip login.zip filezillaportable"
shell.Run zipCommand, 1, true
set shell = nothing

%>


right now its mapping to a virtual directory because it yelled at me for being a physical path so i did the virtual dir. other than that the 7za a.... is the syntax for 7zip to zip the file
I just dont know where to go from here. after i get this working i can easily get it to return the link and previously write the file.
Any suggestions?

Old Pedant
04-20-2010, 07:30 PM
Ummm...no...

What that will end up doing is something like

c:\inetpub\wwwroot\testing_enviro\7za a -tzip login.zip filezillaportable

meaning you are telling the systme to *find* the 7za executable in that directory! Surely that's not what you want.

Surely what you want is something like

c:\"program files"\7-zip\7z -a -tzip c:\inetpub\wwwroot\testing_enviro\login.zip c:\inetpub\wwwroot\testing_enviro\filezillaportable

No??

Old Pedant
04-20-2010, 07:31 PM
p.s.: In my copy of 7Zip, the 7z.exe file is the command line program. I can't find anything named 7za.exe

nvysel24
04-20-2010, 09:51 PM
Ok well i got it working sort of. It will run it but it wont actually zip anything. I have a few other pages that execute batch files. so i decided to have my code execute the batch file which executes 7zip to zip the file.
If i run the batch file manually it will actually zips the file and creates it. but if i run it via the web page it doesn't do anything, doesn't give me any errors or anything. I even put a mkdir test in the batch file before the execution of 7zip code just to test to see if it executes it and it doesn't even make the directory. any suggestions?

Old Pedant
04-21-2010, 07:07 PM
Ummm...if mkdir isn't working then I would say that nothing is working.

Any success you thought you were having is probably illusory. Just nothing at all happening, so you don't see any problems. But you don't see any success, either.

I'd work hard on getting to the point where mkdir works, and then chances are the rest will all work.

nvysel24
04-22-2010, 04:47 PM
ok well. i just tested the mkdir in another batch file i know that is 100% working. i put it in the middle the batch file gives feedback b4 and after its ran though the site. and still nothing it never created the dir. i made sure all the permissions were correct. i actually created a separate folder to test and enable every account on the folder to have every permission and still nothing.
so you have any ideas?
is there a asp function that you know of that can zip? or in the iis manager there is the "application pool" is there a application that i can add to help zip?

Old Pedant
04-22-2010, 07:11 PM
So you are saying that some actions in the batch file both before and after the MKDIR worked correctly??? That is pretty bizarre.

Still, despite what you say, I'd have to guess that it really is a permissions issue somewhere, given those circumstances.

There are components available (probably not free) that can do zipping. Should be able to find them at www.aspin.com