Well I'm having trouble right now with using the <cfzip> tag in CF8.

I'm getting the following error


The destination c:\LocalUser\giovanniristorante.com\www\temp\Archive26.zip_EXP 
specified in the cfzip tag is invalid.

The destination must be a directory and should be accessible by this tag.
 
The error occurred in 
C:\LocalUser\storeFramework\admin\act\act_galleries_uploadPhotos.cfm: line 63
Called from C:\LocalUser\storeFramework\admin\act\act_galleries_savePhoto.cfm: 
line 17
Called from C:\LocalUser\storeFramework\common\actionHandler.cfm: line 4
Called from C:\LocalUser\storeFramework\admin\index.cfm: line 32

61 : <cfzip
62 :     action = "unzip"
63 :     destination = "#theArchiveFilename#_EXP\"
64 :     file = "#theArchiveFilename#"/>
65 :     



The file is uploaded sans the _EXP extension just fine but does not create the 
unzipped folder on line 63 with the _EXP extension. I have made sure that 
permissions are ok. 

Here is the entire CFM page 

<cfset applicationDir = request.physicalPath>
<cfset mypath = request.physicalPath & "\" & "galleries">
<cfset mypath = mypath & "\" & attributes.galleryID>
<cfset theTempDir="#request.appPath#temp\">
 
<cffile action="upload"
destination="#theTempDir#"
filefield="filename"
nameconflict="makeunique">


<cftry>

        <cfif NOT DirectoryExists(theTempDir)>
                <cfdirectory action="create" directory="#theTempDir#">
        </cfif>
    
        <cffile action="upload" 
                destination="#theTempDir#" 
                filefield="filename" 
                nameconflict="makeunique">

        <cfset theArchiveFilename="#theTempDir##cffile.serverFile#">

<cfset theArchiveFilename="#applicationDir#\temp\#cffile.serverFile#">

<cfzip 
        action="list"
    file="#theArchiveFilename#"
    name="extractedFilenameList"
    showdirectory="yes"
    />
    

<cfset filesToExtract="">
<cfloop list="#ValueList(extractedFilenameList.name)#" index="i">
<cfset theExtension=GetFileFromPath(i)>
<cfdump expand="yes" var="#theExtension#">
<cfset theExtension=Reverse(theExtension)>
<cfset foundIndex=Find(".",theExtension,1)>
<cfif foundIndex GT 0>
<cfset theExtension=Reverse(Left(theExtension,foundIndex-1))>
<cfelse>
<cfset theExtension="">
</cfif>

<cfif ListFindNoCase("jpg,jpeg,gif",theExtension)>
<cfset filesToExtract=ListAppend(filesToExtract,i)>
</cfif>
</cfloop>

<cfdump expand="yes" var="#filesToExtract#">


<cfzip
    action = "unzip"
    destination = "#theArchiveFilename#_EXP\"
    file = "#theArchiveFilename#"/>
    
    

<cfdirectory action="list" directory="#theArchiveFilename#_EXP\"  
name="getFilenames">
<cfdump var="#getFilenames#">
<cfset importFilenameList=ValueList(getFilenames.name)>

<cftransaction>

<cfloop list="#importFilenameList#" index="i">

<cfset theFilename=GetFileFromPath(i)>
<cfset theFilePath="#theArchiveFilename#_EXP\">

<cf_max_id
datasource="#datasource#"
tablename="photos"
primarykey="id">

<cfquery name="savePhoto" datasource="#datasource#">
INSERT INTO photos (ID, galleryID, title)
VALUES (#max_id#, #attributes.galleryID#, '#theFilename#')
</cfquery>

<cfset attributes.photoID = max_id>

<cfset mypath = applicationDir & "\">
<cfset mypath = mypath & "\" & "galleries">
<cfset mypath = mypath & "\" & attributes.galleryID>
<cfset mypath = mypath & "\" & attributes.photoID>

<cfif NOT DirectoryExists(mypath)>
<cfdirectory action="CREATE" directory="#mypath#"> 
</cfif>
<cfoutput>the filePath: #theFilePath#<br />mypath: #mypath#<br /></cfoutput>
<cf_autoresizefile imagepath="#mypath#\"
filename="#theFilename#"
filepath="#theFilePath#"
nameconflict="makeunique"
prefix="th_"
thumbsize=96
maxsize=525
thumbpath="#mypath#\">

<cfx_imgsize src="#mypath#\#photo#">
<cfset photoWidth=img_width>
<cfset photoHeight=img_height>
<cfx_imgsize src="#mypath#\#thumbnail#">
<cfset thumbWidth=img_width>
<cfset thumbHeight=img_height>

<cfquery name="updateImageStats" datasource="#datasource#">
UPDATE photos
SET largeWidth=#photoWidth#,
largeHeight=#photoHeight#,
largeFilename='#photo#',
thumbWidth=#thumbWidth#,
thumbHeight=#thumbHeight#,
thumbFilename='#thumbnail#'
WHERE ID=#attributes.photoID#
</cfquery>

</cfloop>

</cftransaction>
<!---
<cf_deletedirectory directory="#theArchiveFilename#_EXP\">--->

<cflocation url="index.cfm?action=editGallery&galleryID=#attributes.galleryID#">







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317469
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to