Skip to content

Commit

Permalink
FC-3084 fix ioUploadFile modifying original filenames unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
justincarter committed Sep 2, 2016
1 parent 9ba9cd7 commit 00f2fcc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/lib/cdn.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,12 @@
<cfelse>
<cfset filename = normalizePath(arguments.destination & "/" & cffile.ServerFile) />
</cfif>

<cfset filename = ioMoveFile(source_localpath="#tmpdir##cffile.serverFile#",dest_location=arguments.location,dest_file=filename,nameconflict=arguments.nameconflict,uniqueamong=arguments.uniqueamong) />


<!--- move the file if the destination location is different to the current temp location, or if the destination filename is different to the current temp filename --->
<cfif getLocation(arguments.location).fullpath & "/" neq replace(tmpdir, "\", "/", "all") OR "/#cffile.serverFile#" neq filename>
<cfset filename = ioMoveFile(source_localpath="#tmpdir##cffile.serverFile#",dest_location=arguments.location,dest_file=filename,nameconflict=arguments.nameconflict,uniqueamong=arguments.uniqueamong) />
</cfif>

<cfreturn filename />
</cffunction>

Expand Down

0 comments on commit 00f2fcc

Please sign in to comment.