Jarrod
Veteran Member
woot simpson
Posts: 1304 Reputation: 20
– / /
Joined: Sep 2006
|
O.P. RE: cgi generate a zip file
python code: import zipfile,os
ziped = zipfile.ZipFile('project.zip', 'w')
print "Content-Type: text/html"
print
print """
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Title</title>
</head><body><center>"""
x=os.listdir("./")
for item in x:
if item!="project.zip":
ziped.write(item)
print "<br>"*5
print"<a href='project.zip'>Click Here to download the source codes</a>"
print"""
</body>
</html>"""
This post was edited on 04-23-2009 at 11:37 AM by Jarrod.
|
|