110 likes | 225 Vues
Explore the CFZIP tag in ColdFusion through this introductory guide by Jared Rypka-Hauer, an Adobe Community Expert. Discover how to read, modify, and write ZIP-format files, including other ZIP-based archive formats like Java JAR, EAR, and WAR files. This guide covers key operations such as creating new ZIP files, unzipping existing ones, and reading single entries, all structured for quick understanding with syntax examples. Engage with advanced features such as filtering and resource reading capabilities.
E N D
CFZIP: A cursory introduction • Jared Rypka-Hauer • Adobe Community Expert - ColdFusion
Who Am I? • Contributor: • Model-Glue • ColdSpring • CFEclipse • Member: • Adobe Community Experts, formerly Team Macromedia • Team Model-Glue • Team Fusebox • Team Fusion
CFZIP: A cursory look • What’s it for? (someone had to ask) • It reads, modifies, and writes ZIP-format files • Does it to anything else? • YES! It works with any zip-format file, so it will work with Java JAR, EAR, and WAR files, as well as any other ZIP-based archive format!
What we’ll cover... • Reading/listing contents • Creating a new zip file • Unzipping an existing zip file • Reading one resource at a time • Q & A
Basic Syntax • <cfzip file=”file/or/dir” destination=”#myZipPath#” /> • That zips up a file or folder to {destination} • Other sorts of things require expanded syntax, like...
Read/List Contents • Make sure everyone’s still awake! • Jump to code...
Read single file entry • Reads zip entries as text • Reads them in as binary, too! • BUMMER: You have to tell it which is which. • Expand from example: filters! w00t!
Create a new ZIP file • Requirements: • Full Moon • 1 goat • 1 large kettle • Water • Salt to taste • Seriously... jump to code
UNZIP! (no, not THAT unzip...) • OK, fine, we’ll just jump to the code then... sheesh.
Other things it can do • One/many files at a time: • delete entries (filter-capable) • “update” (basically an overwrite) • list/read are unique - list by filter/read via list • Filters can be used with: • zip • unzip • delete • list • Filters don’t work with read or readBinary
Resources • New LiveDocs pages for CF8: • http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_u-z_5.html#2851426 • My blog: • http://www.web-relevant.com/blogs/cfobjective • MXNA/FullAsAGoog • http://weblogs.macromedia.com/mxna/ • http://www.fullasagoog.com/ • “Goog” is slang for “egg” • “Full as a goog” means “chock full” in Australia • “Chock full” of Fusioney goodness, that is!