Ticket #1692: 1692.patch
File 1692.patch, 2.5 KB (added by , 15 years ago) |
---|
-
editor/filemanager/connectors/cfm/cf_commands.cfm
32 32 <cfset var sFilePart = ""> 33 33 <cfset var sFileExt = ""> 34 34 <cfset var sFileUrl = ""> 35 <cfset var sTempDir = ""> 35 36 <cfset var sTempFilePath = ""> 36 37 <cfset var errorNumber = 0> 37 38 <cfset var customMsg = 0> 38 39 <cfset var counter = 0> 39 40 <cfset var destination = ""> 40 41 41 <cftry> 42 <cffile action="UPLOAD" filefield="NewFile" destination="#GetTempDirectory()#" nameconflict="makeunique" mode="0755" /> 42 <cftry> 43 <cfif isDefined( "REQUEST.Config.TempDirectory" )> 44 <cfset sTempDir = REQUEST.Config.TempDirectory> 45 <cfelse> 46 <cfset sTempDir = GetTempDirectory()> 47 </cfif> 48 <cfif NOT DirectoryExists (sTempDir)> 49 <cfthrow message="Invalid temporary directory: #sTempDir#"> 50 </cfif> 51 52 <cffile action="UPLOAD" filefield="NewFile" destination="#sTempDir#" nameconflict="makeunique" mode="0755" /> 43 53 <cfset sTempFilePath = CFFILE.ServerDirectory & REQUEST.fs & CFFILE.ServerFile> 44 54 45 55 <!--- Map the virtual path to the local server path. ---> … … 92 102 </cfscript> 93 103 94 104 <cfset destination = sServerDir & sFileName> 95 <!--- 96 <cfdump var="#sTempFilePath#"> 97 <cfoutput ><br /></cfoutput> 98 <cfdump var="#destination#"> 99 <cfabort> 100 ---> 105 101 106 <cflock name="#destination#" timeout="30" type="Exclusive"> 102 107 <cftry> 103 108 <cffile action="move" source="#sTempFilePath#" destination="#destination#" mode="755"> … … 120 125 <cfset customMsg = CFCATCH.Message > 121 126 </cfcatch> 122 127 123 128 </cftry> 124 129 125 130 <cfset SendUploadResults( errorNumber, sFileUrl, sFileName, customMsg ) > 126 131 </cffunction> -
editor/filemanager/connectors/cfm/config.cfm
61 61 // (This feature works in MX 6.0 and above)) 62 62 Config.HtmlExtensions = "html,htm,xml,xsd,txt,js" ; 63 63 64 //Due to known issues with GetTempDirectory function, it is 65 //recommended to set this vairiable to a valid directory 66 //instead of using the GetTempDirectory function 67 //(used by MX 6.0 and above) 68 Config.TempDirectory = GetTempDirectory(); 64 69 65 70 // Configuration settings for each Resource Type 66 71 //