Link to home
Start Free TrialLog in
Avatar of DanM711
DanM711

asked on

create a zip file on an asp page

I need to create an asp page that will return a zip file that I want to dynamically create, containing an image that I pull from a url and some other files that I will want to pull from the server.

something along the lines of:

<%
Response.ContentType = "application/zip"
Response.Buffer = TRUE

set zip server.createobject("some zip component")

zip.addfile("http://www.mydomain.com/myimage.gif")
zip.addfile("localtextfile.txt")

response.write(zip.output())
%>

Can anyone provide me with some example asp code and a suggestion for a component to use.
Avatar of Felipe Souza
Felipe Souza
Flag of Brazil image

Hello

You will have to use a thrid party command line based zip application to zip files using asp. as suggested above, you can use pkzip application for the purpose. But remember following before proceeding

1. You need to have sufficient permissions at your web server to host thrid party componenets
2. You should have write permissions in the folder where you are looking to store resulting zip file.

Ask me if any further details are needed.
Avatar of DanM711
DanM711

ASKER

Thanks, but i'm looking for some example code that will return a zip file, not just create one. So when a user clicks on a link to my asp page it will come up with a open / save dialogue for the zip file straight away.

And i need a component that will allow me to add files into the zip file i'm creating by specifying urls and file paths.
please answer my above 2 questions before i provide you a sample code.. without having server access, this logic wont work..
ASKER CERTIFIED SOLUTION
Avatar of R_Harrison
R_Harrison
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial