Problems with CFZIP on ColdFusion 11

471 views Asked by At

My company recently migrated from Coldfusion 9 to Coldfusion 11. One problem I haven't been able to resolve from this migration is to do with the the way CFZIP works.

In the old server we had a place in our app where we could upload zip files with images and then Coldfusion would unzip them and place them on the server.

<!--- Upload the zip --->
<cffile action="UPLOAD" filefield="vchrZip"
destination="#app_sysfilepath_site#images\somefolder\zip\"
nameconflict="makeunique">

<!--- Create a directory for our images --->
<cfset folder = Mid(file.serverfile, 1, Len(file.serverfile) - 4)>
<cfdirectory action="create" directory="#app_sysfilepath_site#images\somefolder\#folder#">

<!--- Unzip the zip file and place the contents to the directory--->
<cfzip action="unzip"
file="#app_sysfilepath_site#images\somefolder\zip\#file.serverfile#"
destination="#app_sysfilepath_site#images\somefolder\#folder#"
storepath="false">

On coldfusion 9, this would upload the image files to the root of #app_sysfilepath_site#images\somefolder#folder#"

#app_sysfilepath_site#images\somefolder\#folder#"
----> Image.png
----> Image2.png
----> Image3.png

On Coldfusion 11, this is putting a subfolder with the same name as the zip file with the images inside of it.

#app_sysfilepath_site#images\somefolder\#folder#"
---->#folder#
    ----> Image.png
    ----> Image2.png
    ----> Image3.png

I tried changing the storepath to 'no', but that didn't work.

0

There are 0 answers