Skip to main content

Posts

Showing posts with the label system

ColdFusion - How to append text to the page output stream

WriteOutput() - append text to the page output stream WriteOutput.cfm <!DOCTYPE html"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>WriteOutput function example: how to append text to the page output stream</title> </head> <body> <h2 style="color:Crimson">WriteOutput Function Example</h2> <cfscript> Value1=10; value2=15; Value3=25; Sum=Value1+Value2+Value3; WriteOutput("<b>Value1</b>" & "=" & Value1 & "<br/>"); WriteOutput("<b>Value2</b>" & "=" & Value2 & "<br/>"); WriteOutput("<b>Value3</b>" & "=" & Value3 & "<br/>"); WriteOutput("<b>Value1+Value2+Value3</b>= "& Sum); </cfsc...

ColdFusion - How to create a temporary file in a directory

GetTempFile() - create a temporary file in a directory GetTempFile.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetTempFile function example: how to create a temporary file in a directory</title> </head> <body> <h2 style="color:Crimson">GetTempFile Function Example</h2> <cfoutput> <b>Temporary Directory:</b> #GetTempDirectory()# <br /> <b>Craete a Temporary File:</b> #GetTempFile(GetTempDirectory(),"TestTempFile")# </cfoutput> </body> </html> More ColdFusion examples GetBaseTemplatePath() - get the absolute path of an application's base page GetCurrentTemplatePath() - get the current template path who call this function GetDirectoryFromPath() - get a directory from an absolute path GetFileFromPath() - ...

How to get the current ColdFusion page context object

GetPageContext() - get the current coldfusion page context object GetPageContext.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetPageContext function example: how to get the current coldfusion page context object</title> </head> <body> <h2 style="color:Crimson">GetPageContext Function Example</h2> <cfset CurrentPageContext=GetPageContext()> <cfdump var="#CurrentPageContext#" label="Current Page Context"> </body> </html> More ColdFusion examples GetMetaData() - get the metadata information for coldfusion query object GetTempDirectory() - get the temporary directory that coldfusion uses for temporary files SetLocale() - set the country language local for coldfusion processing and the page returned to the client GetMetricData()...

ColdFusion - How to get server parformace metrics

GetMetricData() - get server parformace metrics GetMetricData.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetMetricData function example: how to get server parformace metrics</title> </head> <body> <h2 style="color:Crimson">GetMetricData Function Example</h2> <cfset MetricDataPERF=GetMetricData("perf_monitor")> <cfdump var="#MetricDataPERF#" label="Metric Data[perf_monitor]"> <cfset MetricDataSimpleLoad=GetMetricData("simple_load")> <cfset MetricDataPreviousReqTime=GetMetricData("prev_req_time")> <cfset MetricDataAvgReqTime=GetMetricData("avg_req_time")> <cfoutput> <b>MetricData Simple Load[simple_load]:</b> #MetricDataSimpleLoad# <br /> <b>MetricData Pre...

ColdFusion SetLocale() - How to set the country language local

SetLocale() - set the country language local for coldfusion processing and the page returned to the client SetLocale.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>SetLocale function example: how to set the country language local for coldfusion processing and the page returned to the client</title> </head> <body> <h2 style="color:Crimson">SetLocale Function Example</h2> <cfset Locale = GetLocale()> <cfoutput> <b>current Local:</b> #Locale# <br /> </cfoutput> <cfset NewLocale=SetLocale("English (Canadian)")> <cfset Locale = GetLocale()> <cfoutput> <b>current Local[after change "English(Canadian)"]:</b> #Locale# </cfoutput> </body> </html> More ColdFusion examples GetB...

ColdFusion - How to get the temporary directory

GetTempDirectory() - get the temporary directory that coldfusion uses for temporary files GetTempDirectory.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetTempDirectory function example: how to get the temporary directory that coldfusion uses for temporary files</title> </head> <body> <h2 style="color:Crimson">GetTempDirectory Function Example</h2> <cfset TempDirectory=GetTempDirectory()> <cfoutput> <b>ColdFusion Tempory Directory:</b> #TempDirectory# </cfoutput> </body> </html> More ColdFusion examples GetBaseTemplatePath() - get the absolute path of an application's base page GetContextRoot() - get the path of J2EE server context root for the current request GetCurrentTemplatePath() - get the current template path who cal...

How to get the metadata information for coldfusion query object

GetMetaData() - get the metadata information for coldfusion query object GetMetaDataQuery.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetMetaData function example: how to get the metadata information for coldfusion query object</title> </head> <body> <h2 style="color:Crimson">GetMetaData Function Example:Query</h2> <cfquery name="qBooks" datasource="cfbookclub"> SELECT BookID, Title FROM BOOKS </cfquery> <cfdump var="#qBooks#" label="qBooks"> <br /> <cfset BooksQueryMetaData=GetMetaData(qBooks)> <cfdump var="#BooksQueryMetaData#" label="Books Query MetaData"> </body> </html> More ColdFusion examples GetFileInfo() - get information about a file GetHTTPRequestData...

ColdFusion - How to get HTTP request data

GetHTTPRequestData() - get HTTP request data (content, headers, method, protocol) GetHTTPRequestData.cfm <!DOCTYPE html"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetHTTPRequestData function example: how to get HTTP request data (content, headers, method, protocol)</title> </head> <h2 style="color:Crimson">GetHTTPRequestData Function Example</h2> <cfset HTTPRequestData = GetHttpRequestData()> <cfdump var="#HTTPRequestData#" label="HTTP Request Data"> <cfoutput> <b>Content:</b> #HTTPRequestData.content# <br /> <b>Method:</b> #HTTPRequestData.method# <br /> <b>Protocol:</b> #HTTPRequestData.protocol# <br /> </cfoutput> <cfdump var="#HTTPRequestData.headers#" label="HTTP Request Data-he...

ColdFusion - How to get information about a file

GetFileInfo() - get information about a file GetFileInfo.cfm <!DOCTYPE html"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetFileInfo function example: how to get information about a file</title> </head> <body> <h2 style="color:Crimson">GetFileInfo Function Example: Normal</h2> <cfset MyFile="C:\MyFolder\ReadMe.txt"> <cfoutput> <cfif FileExists(MyFile)> File: #MyFile# <cfset FileInfo=GetFileInfo(MyFile)> <cfdump var="#FileInfo#" label="FileInfo"> <br /> File Name: #FileInfo.Name# <br /> File Path: #FileInfo.Path# <br /> File Parent Directory: #FileInfo.Parent# <br /> File Type: #FileInfo.Type# <br /> Fil...

ColdFusion - How to get a file name from an absolute path

GetFileFromPath() - get a file name from an absolute path GetFileFromPath.cfm <!DOCTYPE html"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetFileFromPath function example: how to get a file name from an absolute path</title> </head> <body> <h2 style="color:Crimson">GetFileFromPath Function Example</h2> <cfset CurrentTemplatePath=GetCurrenttemplatePath()> <cfset CurrentTemplate=GetFileFromPath(CurrentTemplatePath)> <cfoutput> <b>Current Template Path:</b> #CurrentTemplatePath# <br /> <b>Current Template(File) Name:</b> #CurrentTemplate# </cfoutput> </body> </html> More ColdFusion examples GetFileInfo() - get information about a file GetHTTPRequestData() - get HTTP request data (content, headers, method, protocol) GetMe...

ColdFusion - Get a directory from an absolute path

GetDirectoryFromPath() - get a directory from an absolute path GetDirectoryFromPath.cfm <!DOCTYPE html"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetDirectoryFromPath function example: how to get a directory from an absolute path</title> </head> <body> <h2 style="color:Crimson">GetDirectoryFromPath Function Example</h2> <cfset CurrentTemplatePath=GetCurrenttemplatePath()> <cfset CurrentDirectory=GetDirectoryFromPath(CurrentTemplatePath)> <cfoutput> <b>Current Template Path:</b> #CurrentTemplatePath# <br /> <b>Current Directory:</b> #CurrentDirectory# </cfoutput> </body> </html> More ColdFusion examples GetBaseTemplatePath() - get the absolute path of an application's base page GetContextRoot() - get the path of J...

ColdFusion - How to get current template path

GetCurrentTemplatePath() - get the current template path who call this function GetCurrentTemplatePath.cfm <!DOCTYPE html"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetCurrentTemplatePath function example: how to get the current template path who call this function</title> </head> <body> <h2 style="color:Crimson">GetCurrentTemplatePath Function Example</h2> <cfset CurrentTemplatePath=GetCurrentTemplatePath()> <cfoutput> <b>Current Template Path:</b> #CurrentTemplatePath# </cfoutput> </body> </html> More ColdFusion examples GetBaseTemplatePath() - get the absolute path of an application's base page GetContextRoot() - get the path of J2EE server context root for the current request GetDirectoryFromPath() - get a directory from an absolu...

ColdFusion - Get the path of J2EE server context root for the current request

GetContextRoot() - get the path of J2EE server context root for the current request GetContextRoot.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetContextRoot function example: how to get the path of J2EE server context root for the current request</title> </head> <body> <h2 style="color:Crimson">GetContextRoot Function Example</h2> <cfset ContextRoot=GetContextRoot()> <cfset request.URL = "#GetContextRoot()#/CFIDE/administrator/"> <cfoutput> ColdFusion Administrator Page: <a href="#request.URL#">ColdFusion Administrator Page</a> </cfoutput> </body> </html> More ColdFusion examples GetBaseTemplatePath() - get the absolute path of an application's base page GetCurrentTemplatePath() - get the curre...

ColdFusion - Get absolute path of an application's base page

GetBaseTemplatePath() - get the absolute path of an application's base page GetBaseTemplatePath.cfm <!DOCTYPE html"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>GetBaseTemplatePath function example: how to get the absolute path of an application's base page</title> </head> <body> <h2 style="color:Crimson">GetBaseTemplatePath Function Example</h2> <cfset BaseTemplatePath=GetBaseTemplatePath()> <cfoutput> <b>application's base page absolute path:</b> #BaseTemplatePath# </cfoutput> </body> </html> More ColdFusion examples GetContextRoot() - get the path of J2EE server context root for the current request GetCurrentTemplatePath() - get the current template path who call this function GetDirectoryFromPath() - get a directory from an ab...

ColdFusion FileWrite() - How to write the content of a file

FileWrite() - write the content of a file FileWrite.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>FileWrite function example: how to write the content of a file</title> </head> <body> <h2 style="color:Crimson">FileWrite Function Example</h2> <cfset MyFile="C:\ReadMe.txt"> <cfset FileWrite(MyFile,"The text is writen by FileWrite function","utf-8")> <cfset FileText=FileRead(MyFile,"utf-8")> <cfoutput> <b>File:</b> #MyFile# <br /> <b>File Text:</b> #FileText# </cfoutput> </body> </html> More ColdFusion example FileExists() - determine whether a file exists

How to determine whether a file exists in ColdFusion

FileExists() - determine whether a file exists FileExists.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>FileExists function example: how to determine whether a file exists</title> </head> <body> <h2 style="color:Crimson">FileExists Function Example</h2> <cfset File1="C:\ReadMe.txt"> <cfset File2="C:\MyFolder\ReadMe.txt"> <cfoutput> <b> File1: #File1# <br /> File1 Exists?: #FileExists(File1)# <br /><br /> File2: #File2# <br /> File2 Exists?: #FileExists(File2)# </b> </cfoutput> </body> </html> More ColdFusion tutorials CFAJAXIMPORT to specify Google map API Key in ColdFusion ColdFusion CFscript - Invoke a component in script How to cache query...