<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>nuzip</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -8,6 +8,7 @@
 #import &quot;ShareController.h&quot;
 #import &quot;Utilities.h&quot;
 #import &quot;MIMEHelper.h&quot;
+#import &quot;NuZip.h&quot;
 
 @implementation ShareController 
 
@@ -58,7 +59,7 @@
 
 - (NSString *) css
 {
-	return @&quot;&lt;style&gt;/* based on iui.css (c) 2007 by iUI Project Members */ body {     margin: 0;     font-family: Helvetica;     background: #FFFFFF;     color: #000000;     overflow-x: hidden;     -webkit-user-select: none;     -webkit-text-size-adjust: none; }  body &gt; *:not(.toolbar) {     display: none;     position: absolute;     margin: 0;     padding: 0;     left: 0;     top: 45px;     width: 100%;     min-height: 372px; }  body &gt; *[selected=\&quot;true\&quot;] {     display: block; }  a[selected], a:active {     background-color: #194fdb !important;     background-repeat: no-repeat, repeat-x;     background-position: right center, left top;     color: #FFFFFF !important; }  body &gt; .toolbar {     box-sizing: border-box;     -moz-box-sizing: border-box;     -webkit-box-sizing: border-box;     border-bottom: 1px solid #2d3642;     border-top: 1px solid #6d84a2;     padding: 10px;     height: 45px;     background: #6d84a2 repeat-x; }  .toolbar &gt; h1 {     position: absolute;     overflow: hidden;     font-size: 20px;     text-align: center;     font-weight: bold;     text-shadow: rgba(0, 0, 0, 0.4) 0px -1px 0;     text-overflow: ellipsis;     white-space: nowrap;     color: #FFFFFF;      margin: 1px 0 0 -120px;     left: 50%;     width: 240px;     height: 45px; }  body &gt; ul &gt; li {     position: relative;     margin: 0;     border-bottom: 1px solid #E0E0E0;     padding: 8px 0 8px 10px;     font-size: 20px;     font-weight: bold;     list-style: none; }  body &gt; ul &gt; li &gt; a {     display: block;     margin: -8px 0 -8px -10px;     padding: 8px 32px 8px 10px;     text-decoration: none;     color: inherit; }  a[target=\&quot;_replace\&quot;] {     box-sizing: border-box;     -webkit-box-sizing: border-box;     padding-top: 25px;     padding-bottom: 25px;     font-size: 18px;     color: cornflowerblue;     background-color: #FFFFFF;     background-image: none; }  body &gt; .dialog {     top: 0;     width: 100%;     min-height: 417px;     z-index: 2;     background: rgba(0, 0, 0, 0.8);     padding: 0;     text-align: right; }  .dialog &gt; fieldset {     box-sizing: border-box;     -webkit-box-sizing: border-box;     width: 100%;     margin: 0;     border: none;     border-top: 1px solid #6d84a2;     padding: 10px 6px;     background: #7388a5 repeat-x; }  .dialog &gt; fieldset &gt; h1 {     margin: 0 10px 0 10px;     padding: 0;     font-size: 20px;     font-weight: bold;     color: #FFFFFF;     text-shadow: rgba(0, 0, 0, 0.4) 0px -1px 0;     text-align: center; }  .dialog &gt; fieldset &gt; label {     position: absolute;     margin: 16px 0 0 6px;     font-size: 14px;     color: #999999; }  p {     font-family: Helvetica;     background: #FFFFFF;     color: #000000;     padding:15px;     font-size: 20px;     margin-left: 15%;     margin-right: 15%;     text-align: center; }  &lt;/style&gt;&quot;;
+	return @&quot;&lt;style&gt;/* based on iui.css (c) 2007 by iUI Project Members */ body {     margin: 0;     font-family: Helvetica;     background: #FFFFFF;     color: #000000;     overflow-x: hidden;     -webkit-user-select: none;     -webkit-text-size-adjust: none; }  body &gt; *:not(.toolbar) {     display: none;     position: absolute;     margin: 0;     padding: 0;     left: 0;     top: 45px;     width: 100%;     min-height: 372px; }  body &gt; *[selected=\&quot;true\&quot;] {     display: block; }  a[selected], a:active {     background-color: #194fdb !important;     background-repeat: no-repeat, repeat-x;     background-position: right center, left top;     color: #FFFFFF !important; }  body &gt; .toolbar {     box-sizing: border-box;     -moz-box-sizing: border-box;     -webkit-box-sizing: border-box;     border-bottom: 1px solid #2d3642;     border-top: 1px solid #6d84a2;     padding: 10px;     height: 45px;     background: #6d84a2 repeat-x; }  .toolbar &gt; h1 {     position: absolute;     overflow: hidden;     font-size: 20px;     text-align: center;     font-weight: bold;     text-shadow: rgba(0, 0, 0, 0.4) 0px -1px 0;     text-overflow: ellipsis;     white-space: nowrap;     color: #FFFFFF;      margin: 1px 0 0 -120px;     left: 50%;     width: 240px;     height: 45px; }  body &gt; ul &gt; li {     position: relative;     margin: 0;     border-bottom: 1px solid #E0E0E0;     padding: 8px 0 8px 10px;     font-size: 20px;     font-weight: bold;     list-style: none; }  body &gt; ul &gt; li &gt; a {      margin: -8px 0 -8px -10px;     padding: 8px 32px 8px 10px;     text-decoration: none;     color: inherit; }  a[target=\&quot;_replace\&quot;] {     box-sizing: border-box;     -webkit-box-sizing: border-box;     padding-top: 25px;     padding-bottom: 25px;     font-size: 18px;     color: cornflowerblue;     background-color: #FFFFFF;     background-image: none; }  body &gt; .dialog {     top: 0;     width: 100%;     min-height: 417px;     z-index: 2;     background: rgba(0, 0, 0, 0.8);     padding: 0;     text-align: right; }  .dialog &gt; fieldset {     box-sizing: border-box;     -webkit-box-sizing: border-box;     width: 100%;     margin: 0;     border: none;     border-top: 1px solid #6d84a2;     padding: 10px 6px;     background: #7388a5 repeat-x; }  .dialog &gt; fieldset &gt; h1 {     margin: 0 10px 0 10px;     padding: 0;     font-size: 20px;     font-weight: bold;     color: #FFFFFF;     text-shadow: rgba(0, 0, 0, 0.4) 0px -1px 0;     text-align: center; }  .dialog &gt; fieldset &gt; label {     position: absolute;     margin: 16px 0 0 6px;     font-size: 14px;     color: #999999; }  p {     font-family: Helvetica;     background: #FFFFFF;     color: #000000;     padding:15px;     font-size: 20px;     margin-left: 15%;     margin-right: 15%;     text-align: center; }  &lt;/style&gt;&quot;;
 }
 
 - (NSString *) createindex
@@ -92,11 +93,12 @@
 		BOOL isDir;
 		NSString *cpath = [wd stringByAppendingPathComponent:fname];
 		[[NSFileManager defaultManager] fileExistsAtPath:cpath isDirectory:&amp;isDir];
-		[outdata appendFormat:@&quot;&lt;li&gt;&lt;a href=\&quot;%@%@\&quot;&gt;%@%@&lt;/a&gt;&lt;/li&gt;\n&quot;, 
+		[outdata appendFormat:@&quot;&lt;li&gt;&lt;a href=\&quot;%@%@\&quot;&gt;%@%@&lt;/a&gt;%@&lt;/li&gt;\n&quot;, 
 		 cpath, 
 		 isDir ? @&quot;/&quot; : @&quot;&quot;,
 		 fname,
-		 isDir ? @&quot;/&quot; : @&quot;&quot;		 
+		 isDir ? @&quot;/&quot; : @&quot;&quot;, 
+		 isDir ? [NSString stringWithFormat:@&quot;&lt;a href=\&quot;zzzzip%@.zip\&quot;&gt;[zip]&lt;/a&gt;&quot;, cpath] : @&quot;&quot;
 		 ];
 		[cpath release];
 	}
@@ -118,7 +120,7 @@
 	[outdata appendString:[self css]];
 	[outdata appendString:@&quot;&lt;/head&gt;&lt;body&gt;&quot;];
 	[outdata appendString:@&quot;&lt;div class=\&quot;toolbar\&quot;&gt;	&lt;h1 id=\&quot;pageTitle\&quot;&gt;Error&lt;/h1&gt;	&lt;a id=\&quot;backButton\&quot; class=\&quot;button\&quot; href=\&quot;#\&quot;&gt;&lt;/a&gt;    &lt;/div&gt;&quot;];
-	[outdata appendFormat:@&quot;&lt;p id=\&quot;ErrorPara\&quot; selected=\&quot;true\&quot;&gt;&lt;br /&gt;%@&lt;br /&gt;&lt;br /&gt;Return to &lt;a  href=\&quot;upload.html\&quot;&gt;upload page&lt;/a&gt; or &lt;a href=\&quot;/\&quot;&gt;iPocket browser&lt;/a&gt;&lt;/p&gt;&quot;, errorString];
+	[outdata appendFormat:@&quot;&lt;p id=\&quot;ErrorPara\&quot; selected=\&quot;true\&quot;&gt;&lt;br /&gt;%@&lt;br /&gt;&lt;br /&gt;Return to &lt;a  href=\&quot;upload.html\&quot;&gt;upload page&lt;/a&gt; or &lt;a href=\&quot;/\&quot;&gt;Main browser&lt;/a&gt;&lt;/p&gt;&quot;, errorString];
 	[outdata appendString:@&quot;&lt;/body&gt;&lt;/html&gt;\n&quot;];
 	
 	write (fd, [outdata UTF8String], [outdata length]);
@@ -192,6 +194,47 @@
 		return;
 	}
 	
+	NSRange r = [filereq rangeOfString:@&quot;zzzzip&quot;];
+ 	if (r.location != NSNotFound)
+	{
+		NSString *path1 = [filereq substringFromIndex:r.location + 6];
+		NSString *path = [path1 substringToIndex:[path1 length] - 4];
+		printf(&quot;Zip request: %s\n&quot;, [path UTF8String]);
+		
+		NSString *zipRequest = @&quot;zip -o archive.zip&quot;;
+		NSDirectoryEnumerator *direnum = [[NSFileManager defaultManager] enumeratorAtPath:path];
+		
+		NSString *eachFile;
+		while (eachFile = [direnum nextObject])
+		{
+			BOOL isDir;
+			NSString *fpath = [path stringByAppendingPathComponent:eachFile];
+			[[NSFileManager defaultManager] fileExistsAtPath:fpath isDirectory:&amp;isDir];
+			if (!isDir) zipRequest = [zipRequest stringByAppendingFormat:@&quot; %@&quot;,
+						  [fpath stringByReplacingOccurrencesOfString:@&quot; &quot; withString: @&quot;\\ &quot;]];
+		}
+			
+		// CFShow(zipRequest);
+		chdir([DOCUMENTS_FOLDER UTF8String]);
+		[NuZip zip:zipRequest];
+		
+		// Output the file
+		NSString *outcontent = @&quot;HTTP/1.0 200 OK\r\nContent-Type:application/x-compressed\r\n\r\n&quot;;
+		write (fd, [outcontent UTF8String], [outcontent length]);
+		NSData *data = [NSData dataWithContentsOfFile:@&quot;archive.zip&quot;];
+		if (!data)
+		{
+			printf(&quot;Error: file not found.\n&quot;);
+			[self produceError:@&quot;File was not found. Please check the requested path and try again.&quot; forFD:fd];
+			return;
+		}
+		printf(&quot;Writing %d bytes from file\n&quot;, [data length]);
+		write(fd, [data bytes], [data length]);
+		close(fd);
+
+		return;
+	}
+	
 	// Output the file
 	NSString *outcontent = [NSString stringWithFormat:@&quot;HTTP/1.0 200 OK\r\nContent-Type: %@\r\n\r\n&quot;, mime];
 	write (fd, [outcontent UTF8String], [outcontent length]);</diff>
      <filename>ShareController.m</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,11 @@
 		8EE2F9180F72D69F0089C887 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE2F9160F72D69F0089C887 /* Foundation.framework */; };
 		8EE2F9880F72D6AE0089C887 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE2F9870F72D6AE0089C887 /* CoreLocation.framework */; };
 		8EE2F9930F72D6B80089C887 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EE2F9920F72D6B80089C887 /* QuartzCore.framework */; };
+		8EE2FA730F72E0960089C887 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EE2FA680F72E0950089C887 /* ioapi.c */; };
+		8EE2FA740F72E0960089C887 /* mztools.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EE2FA6A0F72E0950089C887 /* mztools.c */; };
+		8EE2FA750F72E0960089C887 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EE2FA6C0F72E0950089C887 /* unzip.c */; };
+		8EE2FA760F72E0960089C887 /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EE2FA6E0F72E0950089C887 /* zip.c */; };
+		8EE2FA770F72E0960089C887 /* NuZip.m in Sources */ = {isa = PBXBuildFile; fileRef = 8EE2FA720F72E0960089C887 /* NuZip.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -42,6 +47,17 @@
 		8EE2F9160F72D69F0089C887 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
 		8EE2F9870F72D6AE0089C887 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
 		8EE2F9920F72D6B80089C887 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+		8EE2FA670F72E0950089C887 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypt.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+		8EE2FA680F72E0950089C887 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ioapi.c; sourceTree = &quot;&lt;group&gt;&quot;; };
+		8EE2FA690F72E0950089C887 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ioapi.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+		8EE2FA6A0F72E0950089C887 /* mztools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mztools.c; sourceTree = &quot;&lt;group&gt;&quot;; };
+		8EE2FA6B0F72E0950089C887 /* mztools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mztools.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+		8EE2FA6C0F72E0950089C887 /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = unzip.c; sourceTree = &quot;&lt;group&gt;&quot;; };
+		8EE2FA6D0F72E0950089C887 /* unzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unzip.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+		8EE2FA6E0F72E0950089C887 /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip.c; sourceTree = &quot;&lt;group&gt;&quot;; };
+		8EE2FA6F0F72E0950089C887 /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zip.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+		8EE2FA710F72E0960089C887 /* NuZip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NuZip.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+		8EE2FA720F72E0960089C887 /* NuZip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NuZip.m; sourceTree = &quot;&lt;group&gt;&quot;; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -74,6 +90,7 @@
 		29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
 			isa = PBXGroup;
 			children = (
+				8EE2FA630F72E07F0089C887 /* nuzip */,
 				8EE2F7AD0F72D48F0089C887 /* AdMob */,
 				8D1107310486CEB800E47090 /* Info.plist */,
 				29B97316FDCFA39411CA2CEA /* main.m */,
@@ -105,6 +122,42 @@
 			name = Frameworks;
 			sourceTree = &quot;&lt;group&gt;&quot;;
 		};
+		8EE2FA630F72E07F0089C887 /* nuzip */ = {
+			isa = PBXGroup;
+			children = (
+				8EE2FA700F72E0950089C887 /* objc */,
+				8EE2FA660F72E0950089C887 /* unzip101e-src */,
+			);
+			name = nuzip;
+			sourceTree = &quot;&lt;group&gt;&quot;;
+		};
+		8EE2FA660F72E0950089C887 /* unzip101e-src */ = {
+			isa = PBXGroup;
+			children = (
+				8EE2FA670F72E0950089C887 /* crypt.h */,
+				8EE2FA680F72E0950089C887 /* ioapi.c */,
+				8EE2FA690F72E0950089C887 /* ioapi.h */,
+				8EE2FA6A0F72E0950089C887 /* mztools.c */,
+				8EE2FA6B0F72E0950089C887 /* mztools.h */,
+				8EE2FA6C0F72E0950089C887 /* unzip.c */,
+				8EE2FA6D0F72E0950089C887 /* unzip.h */,
+				8EE2FA6E0F72E0950089C887 /* zip.c */,
+				8EE2FA6F0F72E0950089C887 /* zip.h */,
+			);
+			name = &quot;unzip101e-src&quot;;
+			path = &quot;nuzip/unzip101e-src&quot;;
+			sourceTree = &quot;&lt;group&gt;&quot;;
+		};
+		8EE2FA700F72E0950089C887 /* objc */ = {
+			isa = PBXGroup;
+			children = (
+				8EE2FA710F72E0960089C887 /* NuZip.h */,
+				8EE2FA720F72E0960089C887 /* NuZip.m */,
+			);
+			name = objc;
+			path = nuzip/objc;
+			sourceTree = &quot;&lt;group&gt;&quot;;
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -169,6 +222,11 @@
 				8EAECCFB0F72C52800C6F597 /* ShareController.m in Sources */,
 				8EAECCFC0F72C52800C6F597 /* MIMEHelper.m in Sources */,
 				8EAECCFD0F72C52800C6F597 /* Utilities.m in Sources */,
+				8EE2FA730F72E0960089C887 /* ioapi.c in Sources */,
+				8EE2FA740F72E0960089C887 /* mztools.c in Sources */,
+				8EE2FA750F72E0960089C887 /* unzip.c in Sources */,
+				8EE2FA760F72E0960089C887 /* zip.c in Sources */,
+				8EE2FA770F72E0960089C887 /* NuZip.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -190,6 +248,7 @@
 					&quot;$(inherited)&quot;,
 					&quot;\&quot;$(SRCROOT)/AdMob\&quot;&quot;,
 				);
+				OTHER_LDFLAGS = &quot;-lZ&quot;;
 				PRODUCT_NAME = iBrowser;
 				&quot;PROVISIONING_PROFILE[sdk=iphoneos*]&quot; = &quot;A2FA5C45-7EC1-4FE4-A834-590BCF399409&quot;;
 			};</diff>
      <filename>iBrowser.xcodeproj/project.pbxproj</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>822b0594a0c1b31f2a66c9d9bb284f7caf2630e8</id>
    </parent>
  </parents>
  <author>
    <name>Erica Sadun</name>
    <email>erica@mindspring.com</email>
  </author>
  <url>http://github.com/erica/ibrowser/commit/5dfda145da7292f2fac448a9db425111fee68de3</url>
  <id>5dfda145da7292f2fac448a9db425111fee68de3</id>
  <committed-date>2009-03-19T15:37:32-07:00</committed-date>
  <authored-date>2009-03-19T15:37:32-07:00</authored-date>
  <message>Added zip for folders -- use as your own risk</message>
  <tree>dd6a73bb80390574ffbfa001d7987aba0f2dbc56</tree>
  <committer>
    <name>Erica Sadun</name>
    <email>erica@mindspring.com</email>
  </committer>
</commit>
