Any idea why CFFILE Write doesn't support its uniqueness, but does CFFile Upload do?
I use CFFILE Write to handle GetHttpRequestData, and the ability to maintain its uniqueness will be very useful. Any ideas?
Well, that is not so. You will have to collapse your own unique names, first checking to see if the file exists, and if it does, then add some extra characters and repeat the check / add until you find something unique.
, (, ).
-
<cfscript> i = 1; myPath = 'D:\webroot\sap\returns\log'; myFileName = orderNumber; </cfscript> <cfloop condition="fileExists('#myPath#\#myFileName#.xml')"> <cfscript> myFileName = '#orderNumber#_#i#'; i += 1; </cfscript> <cfif i GT 100><cfbreak /></cfif> </cfloop> <cffile action="write" file="#myPath#\#myFileName#.xml" output="#xmlString#" />
How to use CreateUUID () as a file name?
Source: https://habr.com/ru/post/1756458/More articles:Order container member with STL - c ++Create a process without raising - c #Changing CIL code to native code in C # - c #Run my asUser program - c #Adding or updating a configuration entry in / etc / environment - linux@Bean inside a class with and without @Configuration - javaWhat is all invalid with const functions? - c ++CSS list list overflow / markup - htmlCan a process with a 32-bit compiled binary use more than 4 GB of memory? - pythonGetting data from a has_many relation in DBIx :: Class - perlAll Articles