ColdFusion Language

10K

Solutions

3K

Contributors

ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.

Share tech news, updates, or what's on your mind.

Sign up to Post

How to Detect Traffic From China language hu-hu (reported in google analytics) and divert to a not available in your region page

I notice traffic with language hu-hu in my google analytics with a high bounce rate.

What is the best way of detecting traffic from China -   with language hu-hu?

I have a cold fusion 2016 site.  Thank you
0
Cloud Class® Course: Amazon Web Services - Basic
LVL 12
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Create multiple PDF using coldfusion and cfcontent. I have the CF query and I need for each person generate the PDF file. The way I do is cfoutput through the query into the variable and then put that variable into cfdocument and then use <cfcontent to produce PDF through the browser. But the broser only producing the PDF for 1 person . I think this is because cfcontent but how can i produce as many PDFs  as people produced by the query  

<cfoutput query="rc.getResultByCompetency" group="rateeID">
    	<cfsavecontent variable="output">
               output here
       </cfsavecontent>
<cfdocument
						name="certificate_#rateeID#"
						orientation ="portrait"
						mimetype="application/pdf" overwrite="true" 
						format="PDF">
					#output#
				</cfdocument>		
	<cfset test = evaluate("certificate_#rateeID#")>
				<cfheader name="content-disposition" value="attachment;filename=#rc.getResultByCompetency.rateeName#.pdf">
				<cfcontent type="application/pdf" variable="#toBinary(test)#" >	
 </cfoutput>

Open in new window

0
I'm attempting to use the following code to upload files in Redactor. The directory path exists. The permissions for the directory are currently overly permissive just for testing. But the file upload box keeps turning red and no file is uploaded. Any ideas where I might be going wrong? Thanks!

Code from the index page:
<script>
  	$R('.redactor', {
		fileUpload: 'js/redactor/file-upload.cfm'
	});
</script>

Open in new window



Content of file-upload.cfm:
<cfsetting enablecfoutputonly="true">

<cfset relativePath = "/modules/downloads/">
<cfset dir = ExpandPath(relativePath)>
	
<cfset files = {}>
<cfif StructKeyExists(FORM, "file")>
	<cfset fileNumber = 1>
	<cfloop list="#FORM.file#" index="i">
		<cffile action="upload" destination="#dir#" nameconflict="makeunique" filefield="file">

		<cfset files["file-"&fileNumber]["name"] = cffile.serverFile>
		<cfset files["file-"&fileNumber]["url"] = relativePath & cffile.serverFile>
		<cfset files["file-"&fileNumber]["id"] = CreateUUID()>
		<cfset fileNumber = fileNumber + 1>
	</cfloop>
<cfelse>
    <cfset files["error"] = "no file uploaded">
    <cfset files["path"] = dir>
</cfif>
<cfheader name="Content-Type" value="application/json">
<cfoutput>#serializejson(files)#</cfoutput>
<cfsetting enablecfoutputonly="false">

Open in new window

0
ColdFusion 9
Windows Server 2008
JQuery

I have captured a signature (Json value - TicketSignature) that I save to database.  I am using JQuery UI Signature to capture the signature (http://keith-wood.name/signature.html).  I can re-generate the signature on a web page without problem by using:

<cfoutput>
          <textarea style="display:none;" name="TicketSignature" id="sig">#TicketSignature#</textarea>
</cfoutput>

<script>
       $(function() {
		$('#redrawSignature').signature('enable').
		signature('draw', $('#sig').val());
		signature('disable'); 
	});
	$('#redrawSignature').signature({disabled: true});
</script>
<div style="margin-top:10px;font-size:12px;margin-bottom:7px;">
          <div id="redrawSignature"></div>
</div>

Open in new window


But when I try to embed the code above in a CFMAIL tag, it will not redraw the signature ... the "redrawSignature" box remains blank ... is this possible within CFMAIL tags?  Works fine on a regular .cfm page to display on the screen, but I need a copy emailed to my customers with their signature.

I have tried moving the TEXTAREA and SCRIPT outside (above) the CFAMIL tags, and also with them inside the tags, with no success.  Any ideas?

Max
0
I am setting up an integration with a third party.   They already have an existing POST to a former affiliate, so I ask them to just put my URL in there and hit our site.  I figured I would just deserialize the JSON and see what comes in, then code to that.  

So I created a   index.cfm file (Coldfusion 11)  on    www.mysite.com/api/order/    

The index.cfm file does nothing but email me a CFDUMP of the URL and FORM variables.
I gave the URL to the company and they hit it.   I receive the email and both CFDUMPs are empty structures.   No URL variables, no FORM variables.

They say they are doing a POST call to the site.   And are using this path:     www.mysite.com/api/order/   

They have hit it multiple times, they get a 200 OK response.   But each time, my mailed dump show empty values even though they are sending JSON over.

What am I missing?    What do I have to do differently to see the data they are sending?

Thanks!
0
My scheduled tasks in ColdFusion 9 are no longer executing.

They attempt to run (I can see that in the log files) but we get a no connection error.

While in the cfadmin, if we try to run a task manually we get this:

There was an error running your scheduled task. Reasons for which scheduled tasks might fail include:

    The scheduled task is paused
    The URL is a redirection URL.
    The URL is protected by IIS NT Challenge/Response or Apache .htaccess password. The Username and Password text fields for editing a scheduled task are intended to support Basic Authentication only.
    The Domain Name lookup failed. Try using the IP address of the domain whenever possible.
    The URL is an SSL site, but the SSL port was specified incorrectly.
    The Web site is not responding.
    The directory specified for published results does not exist.

The scripts will run fine if I paste their URLs into a browser.

I read that its because tasks use CFHTTP and that needs a SSL connection.  So I created a page with CFHTTP calling one of the scripts used in the tasks.
and here is the dump from that.

       struct
Charset      [empty string]
ErrorDetail      I/O Exception: peer not authenticated
Filecontent      Connection Failure
Header      [empty string]
Mimetype      Unable to determine MIME type of file.
Responseheader      
struct [empty]
Statuscode      Connection Failure. Status code unavailable.
Text      YES


These scheduled tasks ran great for years.  But this week the tech support …
0
How do I add to my original SQL statement, a sum of values in a particular field?
I want the same output from my original SQL statement with the receivedQty field totals.
Software: ColdFusion with MS Access

Original SQL Statement:
SELECT OMaterials.KeyID, OMaterials.*, Ship.*, Materialm.*, DO.*, Materialm.projectQty,'' AS RCVDBY
FROM ((Ship INNER JOIN DO ON Ship.KeyID = DO.ShipID) INNER JOIN OMaterials ON DO.KeyID = OMaterials.DOID) INNER JOIN Materialm ON (Ship.KeyID = Materialm.ShipID) AND (OMaterials.MaterialmID = Materialm.KeyID)
WHERE (((Materialm.projectQty)<>0))

Open in new window


How do I add this statement to the above statement? (this statement produces all the related records an adds up the receivedQty totals)
SELECT DISTINCTROW Materialm.KeyID, Sum(OMaterials.receivedQty) AS SumOfreceivedQty
FROM Materialm INNER JOIN OMaterials ON Materialm.KeyID = OMaterials.MaterialmID
GROUP BY Materialm.KeyID;

Open in new window

0
This is about coldfusion 11 search (Solar). When I search for report or reports or "report" or reports" I get an error msg (picture attached). I have no idea where to even start looking to fix this issue. Any other search term, no issues.  Any hints/tips you can give would be greatly appreciated.
0
Is there a way to exclude .cfm and .cfml file from coldfusion search?

<CFSEARCH NAME="searchmysite"
COLLECTION="searchmysite"
CRITERIA="#FORM.criteria#"
ContextHighlightBegin="<b>"
ContextHighlightEnd="</b>"
ContextPassages="1"
 ContextBytes="500"
>

Thanks.
0
I'm trying to process a form submission where there are 3 fields with different names, but 10 instances of the fields. I know it sends the duplicate fields as a delimited list.

My issue is that I'm using the CFLOOP to create 3 variables each iteration, each with a concatenated index value. So my output from the cfloop gives me these variables.
CFLOOP 1
<cfset var1=1>
<cfset var2=6>
<cfset var3=15>

CFLOOP 2
<cfset newvar1=16>
<cfset newvar2=89>
<cfset newvar3=82>

CFLOOP 3
<cfset anothervar1=7>
<cfset anothervar2=9>
<cfset anothervar3=11>

So I have 3 different cfloops doing the same thing. Now, I am ready to insert these variables into a database using the same CFLOOP idea

<cfloop index="x" from="1" to="10">
<cfquery name="addreco" datasource="#mydsn#">
INSERT INTO myDatabase
VALUES (foo,foobar,foofoo)
('#Var("#x#")#','#newvar("#x#")#','#anothervar("#x#")')
</cfquery>

</cfloop>

Is the data inserting formatted right since I'm technically combining two variable names to create a single variable name?  I've read multiple examples online for ways to do this and have only been confused by the proper syntax. I have not yet tested this theoretical format to make the data work.

Help
0
Cloud Class® Course: MCSA MCSE Windows Server 2012
LVL 12
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

I have researched the web for examples and can't find one in Coldfusion.

I have an HTML form with dynamically generated fields with checkbox values. I want to be able to click any combination of checkboxes and have a visual tally showing the sum value of the checked boxes. This will allow the user to know the calculated total of the check boxes as they click on them. The TOTAL value field does not need to be submitted necessarily as a form field, but can be.

Example:

[ ] Checkbox 1 (value=1)
[ ] Checkbox 2 (value=2)
[ ] Checkbox 3 (value=1)

If the user clicks boxes 1 and 3, I want a visual real-time display of the total of those two fields as "2".

Please provide working HTML code and Javascript as I suppose would be needed.
0
I have a sql query w/in Cold Fusion I'm confused about. The colorization of the commented out code isn't showing correctly within dreamweaver:

[code][/<cfquery name="vp" datasource="casprod">
select c.org_id orgid, c.vendor_name vendor, c.address_line1 addr1, c.address_line2 addr2, c.address_line3 addr3,c.city city,c.state state, substr(c.zip,1,5) zip, c.country country, substr(d.attribute1,1,2) doctype, sum(d.amount) tot_amount, count(distinct c.check_id) count
from ap.ap_checks_all c, ap.ap_invoice_payments_all p, ap.ap_invoice_distributions_all d, ap.ap_invoices_all i
where  c.payment_method_lookup_code='CHECK'
and c.amount <> 0
and c.check_id = p.check_id
and p.invoice_id= d.invoice_id
and d.invoice_id = i.invoice_id
and c.status_lookup_code = 'NEGOTIABLE'
and c.org_id =101
and i.source <> 'MILITARY PAY'
and c.check_date >= TRUNC(ADD_MONTHS(SYSDATE, -1),'MM')
and c.check_date <= LAST_DAY(ADD_MONTHS(SYSDATE, -1))
group by c.org_id,c.attribute8,c.vendor_name,c.address_line1,c.address_line2, c.address_line3,c.city,c.state,c.zip,c.country,substr(d.attribute1,1,2)
order by 3

<!---select c.org_id orgid, c.attribute8 attrib8, c.vendor_name vendor, c.address_line1 addr1, c.address_line2 addr2, c.address_line3 addr3,c.city city,c.state state, substr(c.zip,1,5) zip, c.country country, substr(d.attribute1,1,2) doctype, sum(d.amount) tot_amount, count(distinct c.check_id) count
from ap.ap_checks_all c, ap.ap_invoice_payments_all p, ap.ap_invoice_distributions_all…
0
I need to pass params to the coldfusion cfc using Bootstrap table toolbar.

When I click the apply button I am serializing the form into array and now I need to split the variable. I have the code bu I get the  error message Uncaught SyntaxError: missing ) after argument list

$("#btnApply").click(function(){
		
			//alert($("#frm2").serialize());
			var vals  = $("#frm2").serializeArray();
			var str  = "";
			
			
			for (i=0; i<vals.length;i++){
   				str += '&' + $('#' + i.name) + '_title=' + $('#' + i.name').attr('title') + '&' + $('##' + i.name) + '_alt=' + $('##' + i.name').attr('alt');
			}
			 
			 alert(str);
			  
			$('#classes').bootstrapTable('refresh',{query: {str}});
			
			return false;
		})

Open in new window

0
online credit application formHi,

 i have cold fusion web page (.cfm) where potential customers fills out credit application information and submit to us.At this point, anyone can poke around and can stumble upon this .cfm page and fill out the information and submit to us.

 However, due to no protection or verification process in place, we are getting one too many prank/fake applications and I like to do something about it.

 I  have seen examples of protection like requiring the result of multiplication of two numbers:   2 x 3 = 6 or the picture where I am supposed to select blocks in the picture where cars are seen ... etc.

What is the simplest and easiest way of protecting this page from abuse?

Thanks.
0
I have the page that show a table and in one of the table cell I show a progress bar implemented in bootstrap. When the page is shown in HTML it works fine . When I convert the page into PDF the progress bars disappears
0
Working with Client-Side CFCharts and passing JSON controls

I'm using the Zoom-In Preview and want to start the graph zoomed-in.

Zoom-In feature of CfChart, with an initial zoom set
The problem is that the setting for initial zoom-in does not seem to be a valid parameter in Coldfusion CFChart.
Looking at the ZingChart documentation (which is what CfChart uses)  I see the value I need in the scale-x attribute,   But CFChart says that is not a valid parameter and of course there is zero documentation on it.   Does anyone know how to include the scale-x attribute?


<cfset variables.xAxis = {"label"={"text"="Drag the handles to zoom in to the chart","color"="red"},"zooming"="true"}>
<cfset variables.yAxis = {"label"={"text"="Drag the handles to zoom in to the chart","color"="red"},"zooming"="true"}>

<cfset variables.zoom = {"alpha"="0.3","zooming"="true","zoomTo"="[10,30]","adjust-layout"="true","border-color"="black","border-width"=4,"background-color"="gray","label"={"border-color"="red","border-width"=2,"font-size"=10}}>

<cfset variables.preview = {"alpha"="0.3","visible"="true","live"="true","preserve-zoom"="true","border-width"="2","vertical-align"="top","adjust-layout"="true"}>

<cfset variables.plotArea = {"margin"="dynamic dynamic 130px dynamic"}>

<cfset variables.scaleX = {"zooming"="true","zoomTo"="[2,5]","adjust-layout"="true"}>   <!==========  I need to set  ZoomTo Value which is part of Scale-X in ZingCharts

  <cfchart alpha=".7"
	   backgroundColor = "##eeeeee"
         

Open in new window

0
I have an mssql table which has data stored as csv.

I am trying to output the data into individual rows / checkboxes from the field in the database.

EG SQL Query:
<cfquery datasource="#Application.DSN#" dbtype="odbc" name="getgames">
SELECT games
FROM users
WHERE games LIKE '%arma%'
</cfquery>

The query works ands the output is then like:
eso,swtor,wow,rocket league,arma 3

I am using Cold Fusion and trying to output the data as
eso
swtor
wow
rocket league
arma 3

Or potentially as
<cfinput type=checkbox name="games" value="#games#">
where value="#games#", being listed as the individual games

I can't seem to get it to work using a cfloop with delimiters="," OR delimiters="#chr(10)##chr(13)#"

I am looking at something along the lines of
<cfloop query="getgames" index="index" list="#games#" delimiters="#chr(10)##chr(13)#">
#games#
</cfloop>

Or

<cfloop query="getgames" index="index" list="#games#" delimiters=",">
#games#
</cfloop>

Where am I going wrong with this?
0
Using Cold Fusion - How to parse this JSON feed that has structure - array - structures.

I've attached a jpg of the cfdump

I just don't work with structures and arrays much anymore
Structure.jpg
0
Hi,
I have used the above sample codeset to use ckeditor4 integration without ckfinder.
But I am able to browse image file from specified path.
On When we upload the image I am recieving and error message"Incorrect server response."

Same "upload.cfm" code  is used for uploading the image . Please help me.
0
Cloud Class® Course: Python 3 Fundamentals
LVL 12
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Good day,

I have a ColdFusion program which uses an ajax call to populate a SELECT2. The ajax starts populating the SELECT2 after the 3rd character has been entered. What I am looking for is to display the selected value in SELECT2 after the submit button has been pressed. In other words, assume the word “play” is entered. After the submit button has been pressed, I would like to show “play” in the SELECT2. Below please find the CFM and CFC I am using. Any help is greatly appreciated.

comboBoxSelect2Json.cfm
======================
<SCRIPT LANGUAGE="JavaScript">
    function prcForm (form) {
       document.forms[0].action = 'comboBoxSelect2Json.cfm';
       document.forms[0].submit();
    }
</SCRIPT>

<cfif  NOT structKeyExists(form, "hdnMortgCashRMaint00")>
	<cfset valMortgCashRMaint00 = "">
<cfelse>
	<cfset valMortgCashRMaint00 = hdnMortgCashRMaint00>
	<cfdump var = "#itemName#">
</cfif>


<html lang="en">
    <head>
        <title>Test</title>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
        <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
        <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
    </head>
    <body>
        <cfform name="vldContactInfo" method="post" action="">
            <div style="width:520px;margin:0px auto;margin-top:30px;height:500px;">
                <h2>Select Box with Search 

Open in new window

0
Experts,

How to Address Host Header Attack in
ours is a coldfusion site.
0
I am trying to figure out how I can list files that are in my dropbox on page created in Coldfusion. On the dropbox site I have created an app and I now have a App key, app secret, etc.
Can someone please point me in the right direction for how I would get my Coldfusion app to connect to my Dropbox account and list files in a selected folder. I am also hoping that users that are logged in to my site can view these files as well but I don't want them to be able to upload, delete, or edit the files on Dropbox.

I have been trying to authorize using cfhttp but with no success

Thank you for any help you can provide.
0
We have a client that is posting to a cfc using jquery.   These are the form fields that we are getting from them

PORTLET_ORDERS[0][COLUMN]=0
PORTLET_ORDERS[0][ID]=panel_id_1
PORTLET_ORDERS[0][ROW]=0
PORTLET_ORDERS[1][COLUMN]=1
PORTLET_ORDERS[1][ID]=panel_id_2
PORTLET_ORDERS[1][ROW]=0
PORTLET_ORDERS[2][COLUMN]=1
PORTLET_ORDERS[2][ID]=panel_id_3
PORTLET_ORDERS[2][ROW]=1
PORTLET_ORDERS[3][COLUMN]=1
PORTLET_ORDERS[3][ID]=panel_id_4
PORTLET_ORDERS[3][ROW]=2

Open in new window


I feel like I am being stupid but if I want to get the column, id and row for PORTLET_ORDERS[3], how do I do that?   Something as simple as #evaluate("FORM.PORTLET_ORDERS[" & xx & "][ID]")# where xx is a cfloop index doesn't work - it says ID isn't defined which I get.
0
Good morning all, I have a question related to writing an Excel spreadsheet from ColdFusion (XML). I'm not sure if my problem is my Oracle query, or the way I have the XML put together, but I'm getting some errors when I do certain things. I've attached the code that I'm working with and will try to explain what I'm doing. I'm dealing with two tables, "BUDGET_MIPRS_SENT" and "UNOB_REMARKS". This is a one to many, where I may have several remarks listed in UNOB_REMARKS for a specific entry in BUDGET_MIPRS_SENT. What I want to do is be able to have a spreadsheet that has only the three most recent "remarks" rather than all of the remarks for each record in BUDGET_MIPRS_SENT. So I guess I want to group the remarks together and have a single record on the spreadsheet with the 3 latest remarks grouped together. The way I have the query works when I display on a web page, but when trying to get a spreadsheet I get an error:

Context validation error for tag cfoutput. Either the end tag &lt;/cfoutput&gt; encountered on line 669 at column 3 requires a matching start tag or tag cfoutput does not support end tag. <br>The error occurred on line -1. | Referer: | Template: /mcadev/reports/testreport.cfm |
testreport.txt
0
Good afternoon, I was hoping I could get some help. I am trying to send email with attachments with ColdFusion. It would be multiple attachments based on files in a folder. Those files are uploaded during a submission of a form, and that part works well but I'm getting an error whenever I try to attach those files to an email with the cfmail parameter. Below is just some test code:

<CFDIRECTORY NAME="myfiles1"
  DIRECTORY="f:\Websites\MCA\MCA\TempUpload\"
  FILTER="*.*"
  SORT="DateLastModified DESC">

and then my email code is:

<CFPROCESSINGDIRECTIVE SUPPRESSWHITESPACE="No">
<cfmail query="MCALeads"
SUBJECT="!!! HIGH PRIORITY !!! APPROVAL"
FROM="hft@mail.com"
TO="hft@mail.com"
CC="hft@mail.com"
BCC="hft@mail.com">
      
<cfloop query="myfiles1">
<cfmailparam file="#myfiles1.name#">
</cfloop>

-------------------------------------------------------------------------------
STATUS: APPROVED !!! THIS IS A HIGH PRIORITY ACTION !!!

Budget Office,

Please prepare

</cfmail></CFPROCESSINGDIRECTIVE>

I get an error message through the ColdFusion log:
Message: The resource 2292-GSAFEDSIMMIPRInstructions.doc was not found. The root cause was: ''. <br>The error occurred on line 57. | Referer: | Template: /mcadev/emailtest.cfm

I thought maybe ColdFusion wasn't seeing the files, but I renamed the file, and it sees the renaming in the error message so I am at a loss. Any help would be greatly appreciated!!
0

ColdFusion Language

10K

Solutions

3K

Contributors

ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.