cfzip and cfloop won't work together


i have list of pdfs want zip up. in first example below try loop on list , put them cfzipparams within 1 cfzip tag. results in zip file 1 pdf (the last one). in second example loop on list , call cfzip tag once every pdf, appending each pdf separately onto zip file. so, second example works, seems me first example more efficient if worked. why doesn't work?

<cfset filelist = "somefile.pdf|anotherfile.pdf|yetanotherfile.pdf" />

the following add last pdf zip (yetanotherfile.pdf in example).
<cfzip action="zip" file="#samplepath#.zip" overwrite="yes">
<cfloop index="filepath" list="#filelist#" delimiters="|">
<cfzipparam source="#filepath#">
</cfloop>
</cfzip>

the following add 3 pdfs zip file.
<cfloop index="filepath" list="#filelist#" delimiters="|">
<cfzip action="zip" file="#samplepath#.zip" overwrite="no">
<cfzipparam source="#filepath#">
</cfzip>
</cfloop>

your first example ever adding current file definition, not adding list.

it better loop on files creating list of files add , run cfzip function


More discussions in ColdFusion


adobe

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support