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

On my development PC running Coldfusion 2016 I succesfully created a program which uses JSOUP.

When exporting the .CFM to be "live machine" which runs Coldfuison2018 I get the below message
Object Instantiation Exception.
Class not found: org.jsoup.Jsoup
 

Further research on my development PC revealed there are two JSOUP Jar file in C:\ColdFusion11\cfusion\wwwroot\WEB-INF\lib
jsoup.jar
jsoup-1.7.3.jar

I copied the below JAR to my production machine but I am still getting the message
Object Instantiation Exception.
Class not found: org.jsoup.Jsoup

Any help is greatly appreciated
0
Angular Fundamentals
LVL 13
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

hi

we are using ColdFusion 9 standard.
Using CFMAIL, but the spool folder will keep growing because it sends mail only every 3 seconds. and it need to send around 5000 mail every 15 minutes.

our exchange is working properly .
any recommendation to solve this issue  .
0
Good day everyone....I have a problem with an Oracle (SQL) query and Coldfusion. I'm basically trying to query an Oracle database from multiple tables and build a new table. With that new table I want a sequential number in the ID field, starting at 1 and I want to start off slow to verify my data as I add more fields. So I have a simple piece of code below that does a count on my main table, and then I can add the data (count) to my ew table:

<cfquery name="getArt" datasource="PDBDEV">
    SELECT COUNT(*) AS numItems
    FROM BUDGET_MIPRS_SENT
</cfquery>

<cfloop from="1" to="#getArt.numItems#" index="i">

<cfquery name="qrySubmitForm" datasource="PDBDEV">
 INSERT INTO WATERFALL_DATA (WATERFALL_DATA.ID) VALUES (#i#)
 </cfquery>

But now, I want to add a field from the same table...and that fails so I believe I'm missing something. If I add the PROJ_NO field from the BUDGET_MIPRS_SENT table, it makes me add a grouping. And then if I add a group to the query, all I get is one record when I should get about 2000.

<cfquery name="getArt" datasource="PDBDEV">
    SELECT COUNT(*) AS numItems,
   PROJ_NO
    FROM BUDGET_MIPRS_SENT
   GROUP BY PROJ_NO
</cfquery>


So I'm guessing its not as simple as adding data fields?? Any guidance would be greatly appreciated.
0
I have a site that conducts encryption/decryption of data, with the process being guided by a specified encryption key that is included in the application.cfm file. However, since they updated the server to CF 11, I have started consistently getting the following error

An error occurred while trying to encrypt or decrypt your input string: The input and output encodings are not same..
 
The error occurred in D:/home/rilsintake.org/wwwroot/left_side_nav.cfm: line 35
33 : <cfoutput>
34 : <cfloop query="all_calls_in_unit" startrow="#url.startrow#" endrow="#endrow#">
35 :       <li><a href="callback.cfm?intakeid=#intakeid#"> #Decrypt(URLDecode(all_calls_in_unit.CLIENT_LASTNAME), "#enc_key#")#, #client_firstname#</a> -<cfif all_calls_in_unit.court_date is not "">
36 :         <font color="##FF0000">#DateFormat(call_intakedate, 'mm/dd/yy')#</font>
37 :             <cfif all_calls_in_unit.interpreter is 'Y'><br><font color='0000ff'><strong>Interpreter Needed</strong></font></cfif>

Any suggestions will be helpful.
0
Dear experts,

i have an input text form on my page with a value defined
i would like to put a condition with a cfif element to show something, depend on this value defined
but when i try a <cfif form.test eq "x"> it tell me an undefined form element.. Is there a way to show something depending on the value input form with a cfif form on the same loaded page ?
0
To be clear upfront, I'm not a professional - just trying to get a task done and I have minimal expertise. What I thought would be easy is apparently not so. I've dealt with APIs and XML but it's always been me initiating. This is apparently different.

Goal:

Receive HTTP POST Webhook data from my Wordpress/Woocommerce website.

==============================================

If you're receiving an http post and it contains the variable/value status:completed

CFIF CODE HERE

Loop through line_items in this transaction

CFIF CODE HERE

Do this if the item is a download

CFIF CODE HERE

Do some database inserts. I've got all this code written and ready to go.

==============================================

1.  The webhook is working and being received perfectly by RequestBin.
2.  HTTP in JSon is being sent.
3.  I'm not even sure the request is being heard by my CF Template.
4.  When I try to write the received data into a session variable so I can at least see it, nothing is there?!?!
Need to know... Is my code being triggered? If not, how can I make it be so. AND Once I'm able to assess that I'm receiving data, how can I curse down into it and grab the bits of info (is the result an array or structure and what's the syntax to drill down)?? Specifically, I only need...

status

line_items.sku

TIA for HELP.

==============================================

First line of code in my CF template to receive HTTP POST from Webhook

Open in new window

0
Coldfusion / Mysql

I have a database field "photos" that holds a comma delimited string of photo URL's and feeds a slideshow.   the code below works,  but I also now have a field "thumbs" that contains another comma delimited string of photo URL's. I want to populate these as my thumbnail images instead of just using the large image as I have in the below code snip.  How would I accomplish this? Any help appreciated.


<!---this code works but doesnt uses the main photo as a thumbnail--->

<cfloop list="#photos#" index="ListItem" delimiters=",">
	
     <cfoutput>
	 <a class="rsImg" data-rsh="500" data-rsBigImg="#trim(ListFirst(ListItem))#" href="#trim(ListFirst(ListItem))#" alt="#details.AddressNumber# #details.AddressStreet#, #details.City#, #details.State# #details.zipcode#">
		<img width="96" height="72" class="rsTmb" src="#ListItem#" /></a> 
	</cfoutput>

</cfloop>




<!---this code doesnt work--->

<cfloop list="#photos#" index="ListItem" delimiters=",">
<cfloop list="#thumbs#" index="ListItem2" delimiters=",">
	

	 <a class="rsImg" data-rsh="500" data-rsBigImg="#trim(ListFirst(ListItem))#" href="#trim(ListFirst(ListItem))#" alt="#details.AddressNumber# #details.AddressStreet#, #details.City#, #details.State# #details.zipcode#">
		<img width="96" height="72" class="rsTmb" src="#ListItem2#" /></a> 

	</cfloop>
	</cfloop>

Open in new window

0
I need to run some programs sequentially from one CFM.

DailyTask.CFM must call pgmA.cfm which does some database updating.

As soon as pgmA.cfm is done, pgmB.cfm must be called. PgmB.cfm inserts records into a table.

Once PgmB.cfm is finished, pgmC.cfm must be called. PgmC.cfm also updates a table.

pgmA.cfm should not have <cflocation url="pgmB.cfm" > and pgmB.cfm should not have <cflocation url="pgmC.cfm" >

So from with dailytaks.cfm, pgmA.cfm, pgmB.cfm, and pgmc.cfm must be called sequentially.

Is this possible ?
0
Dear Experts,

I work with Coldfusion and from an input type file, i uploaded an image show in the current page. i would like that a resizable rectangle appear when this image upload and be able to crop the image by clicking on a button attached to it when the resizable rectangle appears but still in the current page, without load it by a submit form.
does anyone have some suggestions to do it with Coldfusion and may be Javascript ?

Vahan
0
ExpertsExchangePowershellSanitized.txtHow to do a recursive file lookup in powershell? I have a list of files in Folder A and need to look in Folder B and Folder C to see if that file exists in either B or C. If there is already a file with the same name as the file in A then I need to rename the file from Folder A until there is no file by that name in Folders B or C.  The file signature is this:  SomeCode_Year_Month_Day_Hour_Minutes_Seconds.pdf. When I look in Folder B and C and the file is found I change the name to increment by one second in the "Seconds" part then I copy it to Folder B and Folder C and delete it from Folder A. I had been using the file hash to find the duplicates but that seems like overkill. I just really need to check the file names. Folders A, B, and C are guaranteed to exist. I will need to keep checking the file name and incrementing by one second until there are no duplicate file names.
0
Introduction to R
LVL 13
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

Hello experts,

My client is struggling to put in the CF 2016 Update 8 security patch.

installation begins and then an error appears saying insufficient permissions. same login was used to roll back to update 7.

here is the posting on adobe forums
0
How to access a global variable within a javascript .each() function? Yes, I know this is bad practice but I still need to do it. I'm creating a form with dynamic form input fields. I'm iterating through those fields and if the value is zero or an empty space I want to form validation to let the user know they need to enter a number.  But when I try to edit the global variable or modify a form field value I'm not able to do that. I'm using jquery to do this. Can anybody offer a way validate this form without a plugin? Attached is my code. I'm using cold fusion and jquery as the base language.
EE_simpleJqueryValidation.txt
0
Good morning all!! I have a question related to ColdFusion, JavaScript and IE11. I have some code, that works fine in compatibility view in IE11, that basically is three drop downs, all containing results of a database query. Only the first dropdown is visible at the beginning. If the user selects "More" from the first drop down box, the second box becomes visible. Then if in that second box, a users selects a certain item, the third box will appear. I need to make this work without the dependency of adding the domain to the compatibility view. I thought it would work with no issues, but I was very wrong. Could someone guide me on what I need to change/do to make this work??

<SCRIPT LANGUAGE="JavaScript">	  
function objectShowForm(thisObject, thatObject) {

     // Check for invalid object references
     if (!thisObject || !thatObject) {return false;}
     
     // Get the selected value 
     // (currently only works with single selection lists and text fields)
     if (thisObject.type == "select-one") {
          listIndex = thisObject.selectedIndex;
          var value = thisObject.options[listIndex].value; // you can also use .text
     } else if (thisObject.type == "text") {
          var value = thisObject.value;
     }

     // Show or hide the hidden field
     if (value == "99"){
          showElement(thatObject.name);
     } else {
          hideElement(thatObject.name);
     }
     return true;
}
	
function showElement(elem) {
     if (!elem) {return 

Open in new window

0
I am trying dynamically to insert a structure into MS SQL using the below code.

When I run the code I get the  message.
[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near '<'.

However, when running the resolved SQL no error is shown.

Any help is greatly appreciated

=========================
To create table
=========================
USE [tfdata]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[mortgEdit1](
	[meId] [int] IDENTITY(1,1) NOT NULL,
	[meBatchNo] [int] NULL,
	[meModule] [nvarchar](64) NULL,
	[meActive] [nvarchar](16) NULL,
	[meAction] [int] NULL,
	[meComments] [nvarchar](256) NULL,
	[meDateCreated] [datetime] NULL,
	[meDateUpdated] [datetime] NULL,
	[meCreatedBy] [nvarchar](64) NULL,
	[meUpdatedBy] [nvarchar](64) NULL,
 CONSTRAINT [mortgEdit1_pk] PRIMARY KEY CLUSTERED 
(
	[meId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

Open in new window




=========================
CF Code
=========================

<cfset strucmortgEdit1 = structnew()>
<cfset strucmortgEdit1.meComments = "This is a test">
<cfset strucmortgEdit1.meActive = "Activie">
<cfset strucmortgEdit1.meBatchNo = 250>

<cfset keyList = structKeyList(strucmortgEdit1)>	
<cfset keyValueList = "">
<cfset counter = 1>	

<cfloop List="#keyList#" index="listItem">
    <cfset keyValueList = keyValueList & '<cfqueryparam 

Open in new window

0
Having problems with output from table join. Have 2 tables with a shared field (typeid) but when outputing only shows 1 record from the primary table. Code being used is as follows

<cfquery name="get_problems" datasource='#conn#'>
SELECT w.typeid, w.problem_type, c.typeid, c.problem_area
FROM problem_types w
  INNER JOIN problem_areas c
    ON w.typeid=c.typeid
ORDER BY w.problem_type ASC
</cfquery>
<cfoutput query='get_problems'>
#problem_type#<br>
<ul>
<cfoutput>
<li>#problem_area#</li>
</cfoutput>
</ul>
</cfoutput>
0
I moved the source database of ColdFusion (CF) from SQL 2005 to SQl2008/2012  and the CF  page errors out  when I try to insert
Any inputs

Also I want to know what is causing the insert to fail--what do I have to add to my  cfcatch block below?
I am only seeing this on the page   ---Error occurred while adding to the  database.  Please try again
-----------------------------block
<cfcatch type="any">
                <cfdump var="#cfcatch#" />
      <cfset insertstatus = false>  
   </cfcatch>
 </cftry>
 <cfif insertstatus EQ false>
  <div align="center" class="errorBig">
         Error occurred while adding to the  database.  Please try again
  </div>
0
Good morning, I have a question related to using an multi select HTML box, and passing the selections to a SQL query. I'm using ColdFusion and I have no problems with the creation of the multi text box. I query my database to fill the multi select box:

<SELECT Name="SelectPrograms" MULTIPLE size="12">
      <cfoutput query="ProgramList">
      <option value="#PROGRAM#">#PROGRAM#</option>
</cfoutput>
</SELECT>

On the action page, I did a simple output to make sure I was getting the result from what I had selected:

<cfloop list="#form.SelectPrograms#" index="SelectPrograms">
      
<cfoutput>#SelectPrograms#</cfoutput>
</cfloop>      

I selected two items from the box, and the cfoutput returns correctly. But what I need to do now is to pass those selections to a CFQUERY result WHERE statement, so I want to select various fields from my database where the "Programs" equal the two Programs I selected from the multi select box. This is my problem. My query s only picking up the first one, and not the second so I have my quer where statement incorrect but I'm not sure what it's looking for.

<cfquery name="ProgramList" datasource="MCA_Oracle">
     SELECT BUDGET_MIPRS_SENT.MIPR_NUMBER, BUDGET_MIPRS_SENT.PROGRAM, BUDGET_MIPRS_SENT.MIPR_ID,  BUDGET_MIPRS_SENT.FY
     FROM MCA.BUDGET_MIPRS_SENT
       WHERE
      BUDGET_MIPRS_SENT.PROGRAM = '#SelectPrograms#'            
  </cfquery>


<cfloop query="ProgramList">
<cfoutput>#ProgramList.MIPR_NUMBER#; #ProgramList.PROGRAM#</cfoutput><BR>
      …
0
I am sending a text message to client phone numbers using coldfusion cfmail tag. The problem is as a from I am suing support@testSite.com. The problem is on my email server I do not get a record that the message was sent. What I'm trying to do is to marry questions sent with the response. Now I am getting the responses but I do not see the original message. My email server is Zmail (Zimbra)
0
I have he following code where from the query i am trying to get the first 500 records and then next 500 and so on

Here is my code, i am stuck as to what and where i should make the change to make it work

<cffunction name="queryConvertForJQGRID" access="package" returntype="struct" output="no"> 
    <cfargument name="q" type="query" required="yes"> 
    <cfargument name="page" type="numeric" required="no" default="1"> 
    <cfargument name="rows" type="numeric" required="no" default="10"> 
    <cfset var result = structnew()> 
    <cfset var rowStruct = structnew()> 
    <cfset var col = ""> 
    <cfset result["page"] = arguments.page> 
    <cfset result["total"] = ceiling(arguments.q.recordcount/arguments.rows)> 
    <cfset result["records"] = arguments.q.recordcount> 
    <cfset result["rows"] = arraynew(1)> 
    <cfoutput query="arguments.q" startrow="#(arguments.page-1)*arguments.rows+1#" maxrows="#arguments.rows#"> 
      <cfset rowStruct = structnew()> 
      <cfset rowStruct['viewed'] = viewed>
      <cfset rowStruct['id'] = q['id'][currentrow]> 
      <cfset rowStruct['status'] = q['status'][currentrow]> 
      <cfset rowStruct['template'] = q['template'][currentrow]> 
      <cfset rowStruct['line'] = q['line'][currentrow]>
      <cfset rowStruct['error_message'] = q['error_message'][currentrow]>
      <cfset rowStruct['error_type'] = q['error_type'][currentrow]>
      <cfset rowStruct['datein'] = q['datein'][currentrow]> 
      <cfset 

Open in new window

0
OWASP: Threats Fundamentals
LVL 13
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

I am trying to generate an HTML from an AJAX call, Below please find my code.

The content should display HELLO WORLD in bold. However, I am getting <strong>hello world</strong>

Any assistance is highly appreciated


AJAXHTML.CFM
============
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>

    <script type="text/javascript">

        $(document).ready(function() {
            $("#loadLink").click(function(e) {
                e.preventDefault();
                $.ajax({
                    type: "GET",
                    url: "ajaxHTML.cfc?method=createHTML",
                    contentType: "application/json; charset=utf-8",
                    dataType: "html",
                    success: function(message) {
                        $("#mydiv").html(message);
                    }
                });
            });
        });
    </script>
    
</head>

<body>
    <a href="" id="loadLink">Load Query</a>
    <!-- empty div to load dynamcically generated table into -->
    <div id="mydiv"></div>
</body>

Open in new window


AJAXHTML.CFC
============
<cfcomponent displayname="Generate HTML" output="false">


<cffunction name="createHTML" displayname="Create HTML" description="Creates HTML to output with jQuery." access="remote" output="false" returntype="string">

    <!--- SET VARIABLE TO RETURN --->
    <cfset VARIABLES.html = "">

    <!--- SAVE CONTENT --->

    <cfsavecontent variable="VARIABLES.html">
    	<strong>hello world</strong>
    </cfsavecontent>
    <!--- RETURN SAVED CONTENT --->
    <cfreturn VARIABLES.html>

</cffunction>

</cfcomponent>

Open in new window

0
ColdFusion 9

I am trying to embed a signature image into an email.  The image is created:

<cfoutput><cfsavecontent variable="content">#TicketSignature#</cfsavecontent></cfoutput>
<cfset Signature = ImageReadBase64(content) />
<cfimage name="thisSignature" source="#Signature#" action="read" >

When I "WritetoBrowser" the image appears fine.  All good so far.

In my Cfmail tag I use:

<cfmailparam file="signature.png" contentid="signature" content="#thisSignature#" disposition="inline" type="image/png" />
and
<img src="cid:signature"> to show the image.

My problem:  For some reason the image in the email is viewed as a negative image ... black background and light blue signature.  Somehow, the cfmailparam tag is converting the image.  Why???  I have tried everything I can think of, but nothing will change it back to white background and black signature.

Any thoughts would be very helpful.

Max
0
I have a form that allows the user to create 5 different sets of results on the same form. I do this by using CFLoop. For example:
<cfloop from=”1” to=“5” Index=“i”>
Form FieldName#i#

So I end up with:
FieldName1
FieldName2
FieldName3
FieldName4
FieldName5

That part works great and keeps the form code short and clean considering there are 16 form fields.

Is there a way to loop over that data to insert it into a table. Each Index needs to be its own row in the table. For example…

<cfloop from=”1” to=“5” Index=“z”>
<cfquery datasource = “abc”>
Insert into XYZ (Name)
Values (#form.FieldName[z]#)
</cfquery>

What I don’t know how to do is use a variable (the index) within a variable (Form.Result).  Parts of the form need to go into 6 different tables times 5 sections of the form would be 30 SQL statements vs. 6 if I can loop.
0
I'm trying to duplicate a row in a MySQL table and give it a new ID (which is the primary key column.) If I run the query directly through phpMyAdmin, it works. If I run it on my CF page, it gives me the following error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE tempEvent SET ID = NULL; INSERT INTO calendar SELECT * FROM tempEvent' at line 4

Do you know why this would be? (As a side note, I get the same error if I use the cfqueryparam tag or hardcode a value, and with/without semicolons.) Thanks!

<cfquery datasource="#APPLICATION.ds#" result="copiedEvent">
	CREATE TEMPORARY TABLE tempEvent 
		SELECT * FROM calendar 
		WHERE ID = <cfqueryparam value="#FORM.eventID#" cfsqltype="CF_SQL_INTEGER">;
	UPDATE tempEvent 
		SET ID = NULL;
	INSERT INTO calendar SELECT * FROM tempEvent;
	DROP TEMPORARY TABLE IF EXISTS tempEvent;
</cfquery>

Open in new window

0
I need to create a set of dropdowns that are related to each other in coldfusion. The second dropdown should update itself based on what is selected in the first. Both will draw data from queries but from 2 separate data tables (cities and states). When the form finally submits, want to be able to retrieve id numbers from each dropdown

Have tried a number of coding variations with no luck
0
I need to rewrite a slq query within a cold fusion file to get rid of INDENTITY_ON and IDENTITY_OFF due to security issues. I've started recoding using IDENTIYCOL but I'm stuck. Below is the current code that will need to be rewritten w/ result_name.IDENTITYCOL vs. INSERT_IDENTITY ON/OFF. I opened a previous question about this but that was to work using IDENTIY_INSERT ON/OFF. I'll close that question but really need help on this asap.

1:<cfif ((#duplClaim# NEQ "Y") and (#requestId# EQ 0))>
2:<cfquery name="getNextID" datasource="#dsn#">
3:select (max(id) + 1) as nextID from TLAClaims
4:</cfquery>
5:<cfset requestId = "#getNextID.nextID#">
6:
7:<cfquery name="InsertClaim" datasource="#dsn#">
8:SET IDENTITY_INSERT TLACLAIMS ON
9:insert into TLAClaims (ID, lastName, firstName, eeEmail, travelbegindate, travelenddate, numberofdays,  unit, approver, submitdate, tono, claimAmount, customerNotes,  employeeId, documentation, status, deoEmail, claimType)
10:values ('#requestId#', upper('#lastName#'), upper('#firstName#'), '#eeEmail#', '#travelbegindate#', '#travelenddate#', '#numberofdays#', '#unit#', '#approver#', '#todaysDate#', '#tono#', '#claimAmount#', '#customerNotes#', '#employeeId#', '#documentation#', 'Inactive', '#deoEmail#', '#claimType#')
11:SET IDENTITY_INSERT TLACLAIMS OFF
12:</cfquery>

 I've started writing this code w/o the INSERT_IDENTIY ON/OFF but I'm stuck now:
1:<cfif ((#duplClaim# NEQ "Y") and (#requestId# EQ 0))>
2:<cfquery name="getNextID"…
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.

Top Experts In
ColdFusion Language
<
Monthly
>