FAQ Database Discussion Community


Could not identify the datetime string

datetime,coldfusion
While going through an API documentation, I found that it returns date-time in the following format. 2015-03-17T13:49:31.2735318-04:00 Apart from the date part in the beginning, I could not recognize the format. What does the various fragments of the above date-time string represent? I want to parse the string to ColdFusion...

How to get old Coldfusion MX7 Serial Number In FileSystem

coldfusion,serial-number,coldfusion-7
In production, I had two ColdFusion MX7 Server. One crashed last month and I would retrieve my Serial Number to reinstall my environment. I know that it's possible to get back the Serial number from the Administrator interface but I can't start my server. I'm just able to have access...

SQL Syntax Error submitting query with coldfusion

sql-server,coldfusion
I am getting this error and cannot find where my syntax is messed up can anyone please help me with what I am overlooking! [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'Transaction'. <cfquery datasource="Titlesbymail" name="InsertEntry" result="transactionResult"> INSERT INTO dbo.Transaction (Type, OwnerType) VALUES ( <cfqueryparam value='NonLeased' cfsqltype='cf_sql_varchar' /> , <cfqueryparam value='Owner'...

Build a dynamic cfquery using if statements - ColdFusion

sql-server,coldfusion
I am looking for the best way to create a query based on the values submitted from a form in coldfusion. I was going to create it using <cfif> statements but started running into issues of adding commas after an AND statement but not adding if its the last AND...

Converting a json looking simple value string to a ColdFusion structure

coldfusion,stripe-payments
I do the following in ColdFusion script: svc = new http(); svc.setMethod('post'); svc.setCharset('utf-8'); svc.setUrl('https://api.stripe.com/v1/charges'); svc.addParam(type='header', name='Authorization', value='Bearer #Stripe.mySecretKey#'); svc.addParam(type='formfield', name='amount', value=form.amount); svc.addParam(type='formfield', name='currency', value='usd'); svc.addParam(type='formfield', name='card', value='#form.card#'); svc.addParam(type='formfield', name='description', value='#form.email#'); prefix =...

Create a simple unit tests framework from scratch in Coldfusion

unit-testing,coldfusion,frameworks,coldfusion-9
I know there are existing tools for testing a ColdFusion application (MXUnit, MockBox), but I'm creating a custom tool, so that it will require less configuration. When I run a unit test file, it's done via a generic 'model' which retrieves all functions from the unit test file. Within each...

using a query as an argument to a cffunction

coldfusion,cffunction
I would like to pass a query as a parameter to a function. According to the docs You can specify query as an argument type. However, when I try doing this: <cfquery name="share_types_query" datasource="phonebook"> SELECT share_loan_type, share_loan_description FROM shareloantypes WHERE share_loan='S' ORDER BY share_loan_type </cfquery> <cfscript> phonebookQuery(share_types_query, "SHARE_TYPES"); </cfscript> <!--function...

ColdFusion DateDiff - Is there a better way?

mysql,coldfusion,datediff,simplify
I simply want to combine the total years of service from various members of my team. The below script works fine, however, the hire date for each member does not pull from a database. Which means I have to hard code each persons hiredate and then do a DateDiff on...

Assigning Loop Number to a Phrase

coldfusion
I have a dropdown on my first page that allows the user to choose a number 1 - 5. I assign the dropdown(pcount) to a session variable like this: <cfparam name="form.pcount" default="#session.checkout.quantity.pcount#"> My very next page then loops that many times like this: <cfset Peoplecount = 1> <cfloop index="Add" from="1"...

code optimizing in coldfusoin, as String are immutable in Coldfusion

coldfusion,coldfusion-9
I am new to Coldfusion and trying to build a string something like <cfif qRoute.a IS NOT ""> <cfset str= qRoute.a> <cfif qRoute.b IS NOT ""> <cfset str= str& " / "& qRoute.b> </cfif> <cfif qRoute.c IS NOT "" > <cfset str= str& " / "& qRoute.c> </cfif> </cfif> But...

Coldfusion 9 serializeJSON()

json,coldfusion,adobe,coldfusion-9,cfml
Anytime that I use serializeJSON in cf9 the JSON it returns is prepended with '//'. This is pretty frustrating because even coldfusion will throw an error trying to decode that as json. For example: var a = { stuff = 'some content' }; a = serializejSON( a ); // the...

Coldfusion dynamic output of Bootstrap tabs

dynamic,coldfusion,tabs,bootstrap
Can anyone tell me why this code for bootstrap tabs doesn't work? The tabs are visible and mouse over in the normal way, but nothing happens when I click on them? <div role="tabpanel"> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#home" aria- controls="home" role="tab" data-toggle="tab">Home</a></li> <cfoutput...

How to find occurrences of a specific string within an unordered list in ColdFusion?

regex,coldfusion
Our database stores a "table of contents" for each issue of our magazine as an unordered list. I want to create an "Articles related to #specificString#" page, so I'd like to query for the Table of Contents, and then find and display only those list items containing that specific string....

Regex Base64 image with headers

regex,coldfusion
I'm having an issue with base64 images that are not converting correctly sometimes. I need a way to test if the image is in correct base64 format before converting it so I can try to look further into the problem. I have found some regex formulas online, but I think...

ArrayResize() creates undefined objects

arrays,coldfusion,coldfusion-11
I want an array of 16 blank items I don't want to this.arConfig = ['','','','','','','','','','','','','','','','','']; When I try ArrayResize(this.arConfig, 16); I get Is there a way to cleanly load this. Note: I expect that someday 16 won't be enough....

Decoding Base64 to an Image in ColdFusion

javascript,coldfusion,cfml,topaz-signatures
A while back I posted a question regarding decoding a Base64 string into a image to store in my ColdFusion application. Here's the link. I was getting the string from a Topaz signature pad that had an NAPI browser plugin that created the Base64 string. I would then take that...

Using iText to save pdf to ColdFusion Variable

pdf,coldfusion,itext
I need to use iText with ColdFusion (CF) because CFDocument won't do everything I need it to, however I would like to return the result into a CF Variable instead of saving it to a file. It seems that every example out there saves the results to a file. I'm...

How can I send this XML request to my server and have it send to and get a response from another server

xml,https,coldfusion
My situation is I need to send an XML request to a user validation server from my desktop application that is installed on multiple users workstations. The validation server has a strict whitelist policy so they will not accept the request from multiple users whose IP would probably change regularly....

Run a cfquery inside of a query output

sql-server,coldfusion,cfquery
I am getting weird unexpected results when I try to run a cfquery inside of the output of a previous query. Example: <cfoutput query="reportInfo"> <tr> <td>#id#</td> <td>#name#</td> <cfif Status EQ 'Complete'> <cfquery name="submitInfo" datasource="RC"> SELECT * FROM Action_Log WHERE Form_ID = '#id#' AND Action = 'Complete' OR Action = 'Saved'...

How to skip unsupported image using cfimage processing?

coldfusion,coldfusion-10,cfml
I am using ColdFusion 10. When trying to read some image files, ColdFusion returns no values and no error messages are shown. I tried to re-size an image using cfimage tag. It is crashing. So I tried to get info about the image using "imageinfo" function. It returns blank. Please...

ColdFusion Dynamic Loop with jQuery Validation Plugin Creating Dynamic Rule

jquery,coldfusion,jquery-validate
I am using the jQuery Validation Plugin. I have a dynamic form that is created based on 1-5 depending on what number the user chooses for the loop. I am struggling on writing the dynamic portion to make each form field work correctly on each loop. <!--- Looping Validation --->...

Get total time and create an average based on timestamps

math,time,coldfusion
Background: I want to use coldfusion to find the total time a process takes by taking two timestamps and then adding all of the total times to create an average. Question: What is the best way to take two timestamps and find out the difference in time by minutes. Example:...

jQuery AJAX and functions in a CFM file

javascript,jquery,ajax,coldfusion
I have been searching for this for about 3 days now and I still cannot find the proper answer to my question. I apologize if this question has been previously asked. Please share with me a link to the proper answer. Question. Is it possible to use jQuery AJAX to...

Process ColdFusion Form with Component

forms,function,methods,coldfusion,cfc
When a Coldfusion form calls a cfc as the action, is it possible for the browser to stay on the form page or does the component function have to reroute it back to the form page? <cfform name="crops" action="cfc/stages.cfc?method=update" method="post"> Once the form above is posted, it stays on the...

ColdFusion ~ Class must not be an interface (OSX only)

java,osx,coldfusion
I'm creating a credential object using the Google API Java Client. The following code works on Windows, but throws an error on OSX 10.10.3 (Yosemite). <cfscript> httpTransport = createObject("java", "com.google.api.client.http.javanet.NetHttpTransport").init(); jsonFactory = createObject("java","com.google.api.client.json.jackson2.JacksonFactory").init(); credential = createObject("java", "com.google.api.client.googleapis.auth.oauth2.GoogleCredential$Builder").init(); </cfscript> I am able to call createObject on some of the...

executing cfquery in cfc with parameters received via AJAX [duplicate]

javascript,ajax,coldfusion
This question already has an answer here: How to override SQL sanitization in ColdFusion 3 answers I am trying to set up a system that allows me to get data from my ColdFusion database from my JavaScript code. However, I am running into an error and I am not...

JSOUP - How to get list of disallowed tags found in html?

coldfusion,jsoup,whitelist
I use JSoup to secure rich text areas against harmful code. How do I get a list of all the disallowed tag/code found in the string passed to JSoup's parse, clean or isValid functions? I use ColdFusion and can parse the text with JSoup like this: var jsoupDocument = application.jsoup.parse(...

Error Executing Database Query (issue with WHERE clause?)

sql-server-2008,coldfusion
I'm trying to build a Query using CF variables for the FIELDS and WHERE clause. I'm getting an "Error Executing Database Query" with the following code. When I render the CF variables to give a literal, and then base the Query body on the resulting literal, everything works fine. I've...

how to display other information after hitting the button?

html,coldfusion
My intention is: first I want to display a button on the page, after hitting the button, the button will be removed and display some other information. Thus I used the following code, but it doesn't work, the button is still there and "other information" doesn't show either. Can you...

Passing Coldfusion Form Values to javascript and CFC , code not working

javascript,jquery,ajax,coldfusion
I'm trying to pass my form values into a javascript function which would pass them into my CFC function for insertion into the database, but its not working. JS code is below: Updated: removed "." in front of alert() and url: $(document).ready(function() { $("#createReport").click(function(f) { var getReportName = $("input#reportName").val(); var...

Bind failed: Item not found error in CF11

javascript,jquery,html,coldfusion
I recently began development in ColdFusion 11 and I'm having some issues with the "bind" property of cfselect. I've been researching online and reading the available documentation but I still have the same error. I am trying to build a data entry form with two select boxes where the values...

How to get associative arrays notation to assign simple values

coldfusion,coldfusion-11
I created sample code using the Microsoft SQL Server Northwind demo database. If you don't have access to this demo database here is a simple (MS-SQL) script to create the table and a row of data for this question. CREATE TABLE [dbo].[Products]( [ProductID] [int] IDENTITY(1,1) NOT NULL, [ProductName] [nvarchar](40) NOT...

Dynamic bootstrap active tab

coldfusion,bootstrap,tabpanel
Is there a way I can get rid of the hard coded active tab and corresponding panel when outputting dynamic content? I would like somehow to make the first iteration of dynamic content to be the active tab + panel. The code below works fine, but the active tab/panel is...

getting result metadata from coldfusion newQuery() in cfscript

coldfusion,cfquery
Documentation on CFscript is a bit sparse in the docs, and searching for a cfscript specific answer gets lost in CF tag answers. So here's my question: How do I get the result metadata from a query that was performed using script? Using tags I can add result="myNamedResultVar" to my...

How Do you Reference Coldfusion Instances in Clustered Server Environment

coldfusion,instance
If there are multiple Coldfusion instances on a server, in a clustered server environment, how do you reference it? For instance, if we had multiple servers and we wanted to find out which server we were hitting with a web call we could use #CGI.Server_Name# which would gives the IP...

Coldfusion Link To Previous Page Remembers Text,Radio, and Dropdowns that were chosen

coldfusion
I am trying to create a form with session variables. Where I can link back to the form and show what the user has previously entered. I have figured out a way to show input box values like below: INPUT <cfif structKeyExists(session, 'firstName')> <cfset form_first_name = "#session.firstName#"> </cfif> </cfif> <input...

trying to find the value is numeric or integer from string

coldfusion
With the url string below, I need to find the value of the parameter named construction. <cfset understand = "http://www.example.com/ops.cfm?id=code&construction=148&construction=150&Building=852&Building=665&Building=348&Building=619&Building=625&Building=626&_=1426353166006&action=SUBMIT"> <cfset understand2 =...

What is the correct syntax to test whether a structure key and data exists?

coldfusion,coldfusion-10
I am having an issue testing for the existence of a specific structure key and data using structKeyExists(). I want my query results to be stored in structures like this: APPLICATION.MemQs.ProdCountQs[1].ExpirationDate; APPLICATION.MemQs.ProdCountQs[1].ProdCount; APPLICATION.MemQs.ProdCountQs[2].ExpirationDate; APPLICATION.MemQs.ProdCountQs[2].ProdCount; APPLICATION.MemQs.ProdCountQs[3].ExpirationDate; APPLICATION.MemQs.ProdCountQs[3].ProdCount; // CREATE MEMORY QUERIES ~ works great if (structKeyExists(APPLICATION, "MemQs") == false) {...

passing an ID with a coldfusion element into a jQuery function

jquery,coldfusion
I am attempting to eventually create this page that will show a relative hidden list of data when a "plus" or "minus" image is clicked next an element that contains the list. Right now, as a button is clicked, all of the other buttons change in addition to the clicked...

Convert Special Characters to HTML - ColdFusion

coldfusion,coldfusion-11
I need to convert a lot of special characters to their html format and I am trying to do this with a function that is using ReplaceList but something is wrong with the function or the values I am passing to it. This is the function <cffunction name="HtmlUnEditFormat" access="public" returntype="string"...

How to get raw binary from hash function in ColdFusion 9?

coldfusion,coldfusion-9,sha
In ColdFusion 9, I am hashing a string like so: hash("bob", "SHA1"), I need it to return binary instead of a hex string.

How to sanitize form values to allow text-only

coldfusion,sanitization,coldfusion-11,antisamy
I understand that if a user needs to supply HTML code as part of a form input (e.g. in a textarea) then I use an Anti-Samy policy to filter out the hazardous HTML that's not permitted. However, I have some text-fields and text-areas which should be text-only. No HTML code...

CFZip of certain file type

coldfusion,cfzip
Is it possible to use cfzip to create a zip folder containing of a certain type. I need to do this to take out .bak files from a folder with different filetypes and insert them into a zip folder. Thanks Colin...

cgi.SERVER_NAME reverts origin

coldfusion
I have two versions of a site, one for spanish, one for english. The spanish subdomain is set via IIS and a C Name (network admin told me, I'm not sure how or what that means), it's not a separate subdomain. es.website.com en.website.com Now, when I use CGI.SERVER_NAME on my...

Remove duplicates from a list in CF10

coldfusion,coldfusion-10
I have the following string but before I use this string, I want to remove the duplicates from it: http://website.com/abc.asp?type=298&action=SUBMIT&product=&contribution=&rateTerm=&surrYr=&mva=&rop=&sortBy=1&sortOrder=2&pagenum=3&company=&product=&state=&contribution=&rateTerm=&surrYr=&mva=&rop= I tried using the cflib Function listRemoveDuplicates, but that does not seem to solve the issue. It should look like:...

cfcomponent web service - getting SOAP attributes

web-services,soap,coldfusion
Here is a SOAP request example: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws_test"> <soapenv:Header/> <soapenv:Body> <ws:testService a1="a1" a2="a2"> <ws:e1>e1</ws:e1> <ws:e2>e2</ws:e2> </ws:testService> </soapenv:Body> </soapenv:Envelope> And here is my example cfc web service: <cfcomponent style="document" wsversion = 1> <cffunction name="testService" returntype="String" access="remote" > <cfargument...

ColdFusion logging vs performance

coldfusion,coldfusion-8
I am wondering what kind of performance hit I can expect if I enable logging for the following two logs in ColdFusion 8 on a IIS webserver connected to sql 2005 server. Log slow pages taking longer than Enable logging for scheduled tasks ...

Pass List of Integers to Stored Procedure

sql-server,coldfusion
Here is my stored procedure: ALTER PROCEDURE [dbo].[Dan] @numbers varchar(10) AS BEGIN SET NOCOUNT ON; select @numbers numbers END In SSMS, I can execute it successfully like this: exec dbo.Dan '1.2' In ColdFusion, I can execute it successfully with either of these two sets of commands: <cfstoredproc procedure="dbo.dan" datasource="ClinicalDataDev"> <cfprocparam...

IIS7 doesn't redirect to index in localhost

asp.net,iis,coldfusion
I've installed Coldfusion 11 locally (IIS7 Handler mappings for cfc,cfm,cfml,cfr,cfsw are all there) and when I type the full address to my index page there are no problems for the page to load: http://localhost:8080/mysite/index.cfm but when I simply input: http://localhost:8080/mysite/ I get the following error: ================================ Server Error in '/'...

Get number of files in various subdirectories relative to the current page - ColdFusion

coldfusion,directory,cfdirectory
I have some cf code which is almost working I think. I have the following structure: work --still-life --portraits --personal In each of these folders there is the same structure: still-life --img-s --img-m --img-l I want to know how many files are in the first directory (img-s) for each of...

Hashed password sometimes longer than 128 characters

coldfusion
I'm having a weird security-related problem, lately I've been getting regular but intermittent errors when trying to insert hashed passwords in a SQL Server database field that's nvarchar(130): <cfqueryparam value="#hashpass#" cfsqltype="cf_sql_char" maxLength="130"> The hashpass variable is set thus: <cfset hashpass = Hash(arguments.password & getsalt.user_salt, "SHA-512")> Wondering how it's possible for...

Coldfusion CFGRID started showing as empty

coldfusion,coldfusion-8
I have a CMS that has been working without any issue until yesterday when the team reported that the pages are coming up empty, I tested it and it was fine for a while and then I suddently started having the same problem. Tried different browsers, etc. but no difference....

Coldfusion REST service not found error

rest,coldfusion
I have a problem with calling REST servise. It returns NOT FOUND error always. REST service is registered in CF administrator: Root path: D:\projects\testcf11\restfolder Host: testcf11.localhost Service Mapping: testrest In /restfolder is one cf component: <cfcomponent rest="true" restpath="Customers"> <cffunction name="getCustomer" restpath="{customerID}" access="remote" returntype="String" httpmethod="GET"> <cfargument name="customerID" required="true" restargsource="Path" type="numeric"> <cfset...

Schedule a task to run monthly the second week?

coldfusion,coldfusion-9
I have a task that runs the 1st monthly, but I would like it to run the second Tuesday of each month. Is there a way I can schedule this on Coldfusion admin? Or how can I make this happen? The task is very simple it just sends a email...

Compressing a PDF document generated by coldfusion

pdf,coldfusion,coldfusion-8,pdf-conversion
I'm trying to overhaul a pdf report generation application built in CF8 and they have an interface which generates a 50 page legal report as a pdf and sends it out about 100x a day. However, its very cumbersome and bogs down an already overworked server. Is there a good...

Concatenate form element name with coldfusion counting variable

forms,coldfusion
I'm trying to access individual form elements within a cfquery tag using the form.elementName + countingVariable. Can someone tell me what the syntax is to do this properly. <form> <select name="SetID0"> <option></option> ... </select> </form> <cfquery> <cfqueryparam value="#"form.SetID & #i#"#" CFSQLType="CF_SQL_CHAR">, </cfquery> I know there may be a better way...

Disappearing content in HTML Layout of Coldfusion Datagrid

html,css,coldfusion,coldfusion-9
I'm having an issue with my CFM page layout. I'm laying out a CFM page with 3 components in the top level div and they are displaying nicely. However when I set a new div below it and place a Coldfusion datagrid in a coldfusion form tag then test it,...

trying to get contents of all tables having a class attribute

regex,coldfusion
using coldfusion, i am fetching all tables using the RematchNoCase command <cfset data = REMatchNoCase('<table.*?</*.table*.>','#header#')> i am getting the values as an array, but i want to get only thos tables who has a class of grids like <cfset data = REMatchNoCase('<table class="grids".*?</*.table*.>','#header#')> but i am getting an empty array...

Github pages/Jekyll Coldfusion redirect

redirect,coldfusion,jekyll,url-redirection,github-pages
I've just moved my Jekyll site to Github pages, however I realised that I have a couple of Coldfusion redirects - e.g. http://mysite/index.cfm?page=disclaimer. These links are relied on from various locations on the web, is there anyway I can make it work? I have read up on Jekyll redirect-from plugin,...

Match a single senerio with ANTLR and skip everything else as noise

java,parsing,coldfusion,antlr
I defined a simple grammar using an ANTLR V4 Eclipse Plugin. I want to parse a file that contains Coldfusion cfscript code, and find every instance of a property definition. For example: property name="productTypeID" ormtype="string" length="32" fieldtype="id" generator="uuid" unsavedvalue="" default=""; That is, a property keyword followed by any number of...

Regex prefix lookaround not working in coldfusion 10

regex,coldfusion,coldfusion-10
I am using reMatch to get the matched substring from a list. But when I am using prefix lookaround then I am getting error. Sequence (?<...) not recognized Code: <cfset local.path = "schedule.category.classes.name,schedule.category.classes.id"> <cfset local.regex = "(?<=schedule.category.classes.)[a-zA-Z0-9_]*?(?=,|$)"> <cfset local.output = reMatch(local.regex, local.path)> What am I missing? ...

If null statement in ColdFusion

coldfusion
I am trying to say if this makeCodeNumber is defined and is not null use this <cfpdfformparam name="make" value="#session.checkout.vehicle.makeCodeNumber#"> but if it is null (or empty) then use this <cfpdfformparam name="make" value="#session.checkout.vehicle.vehiclemake#"> All the code <cfif isDefined("session.checkout.vehicle.makeCodeNumber")> <cfif len(trim("session.checkout.vehicle.makeCodeNumber"))> <cfpdfformparam name="make" value="#session.checkout.vehicle.makeCodeNumber#"> <cfelse>...

How to write a Javascript function to update a Coldfusion form display

javascript,jquery,coldfusion,coldfusion-9
I'm working on an app which has 2 Cfform elements that display the results from DB table. I'm wanting to update the content of the DB table and have the cfform elements update without doing a page refresh. How do I incorporate javascript into my code to handle asynchronously refreshing...

How to get the recordcount of JSON results returned from Coldfusion Component?

json,coldfusion
I have a Coldfusion Component which returns my search results from a query in JSON using serializeJSON(myquery). The results returned dont have the ROWCOUNT before the COLUMNS, if i do return the results with the ROWCOUNT then it messes everything up. What is the best way to display the recordcount...

using a coldfusion variable in a javascript function name

javascript,coldfusion
I have a function in a .cfm template that gets called multiple times in another page. The problem is, I need the functions name to be dynamic. Is there a way to concatenate a ColdFusion variable with a javascript function name? Like so: CFML: <cfset id = ""> JS: function...

ColdFusion Component Not Returning Query

coldfusion,cfc
I have tried, off and on, for about 6 months or so to figure out CFC's but never could get it. So now I have SQL and LDAP queries scattered around in different pages that I would like to consolidate into a component. The query below works in it's own...

ColdFusion calling session function

session,coldfusion,cfc
I have a user object that I would like to have in the session variable and be able to update as needed. How do I call a function in an existing user object that will manipulate the existing variable. I found way to call the function, but it's not calling...

Fixing the URL with Coldfusion regex

regex,coldfusion
I need to edit some URL data, but i am facing some issue, the url is coming as: <cfset myurl = "http:/example.com/0.asp?rpttype=298&companyQ=148&companyQ=150&companyQ=176&companyQ=186&companyQ=195&companyQ=105&companyQ=136&companyQ=126&productQ=1072&productQ=1042&productQ=1043stateQ=&sortBy=1&sortOrder=1"> <cfset reURL = queryStringDeleteVar("companyQ",myurl)> <cfset reURL = queryStringDeleteVar("productQ",reURL)> <cfset reURL = reURL &...

Is there a way to add numeric values together in a string without looping?

coldfusion,coldfusion-9
I have a string say: '212'. This string is dynamically generated. Is there a way to add these numbers together without looping? If needed, I will loop and add the values; but after researching the Adobe Docs I wanted to see if there was a better way. Thank you...

Is it possible to use C++ CFX tags in Railo?

coldfusion,railo
I recently had to move several older websites that were running in Coldfusion MX7 onto a server running Railo 4.2.1. These sites all use either CFX_Image or CFX_OpenImage tags for resizing uploaded images. It looks like I could rewrite them all to use CFIMAGE, but I'm hoping to get these...

How to get list of valid tags of Jsoup whitelist?

java,coldfusion,jsoup
How do I get a list of all the valid tags of a given Jsoup Whitelist? I can't find such a function in the docs at Jsoup whitelist docs. I use ColdFusion, but a java solution or hint would be fine. I guess I could translate it....

Scan folder and output all file names in coldfusion

coldfusion
I am trying to scan all files in a folder and output their file names. My code here only outputs the first file name of that file type <cfset filetypes = arrayNew(1)> <cfset arrayAppend(filetypes, "jpg")> <cfset arrayAppend(filetypes, "txt")> <cfset arrayAppend(filetypes, "pdf")> <cfloop index="i" from="1" to="#arrayLen(filetypes)#"> <cfdirectory action="list" directory="filepath" name="Files" recurse...

Using onMissingMethod cannot access object variables

coldfusion,coldfusion-10,railo
In CF10, I want to access a variable Test object using onMissingMethod function in TestHelper object, but I am getting an error. Test.cfc component { public Any function init(){ instance = { x = 1 }; return this; } public numeric function getX(){ return instance.x; } } TestHelper.cfc component {...

(Coldfusion) Prevent submit button from being exported to excel with table data

coldfusion,submit,export-to-excel
I'm working on getting an html table to export to excel using coldfusion. I've got the table to export successfully but I have run into 2 problems. First, the submit button I use to initiate the export is being sent to the excel file with the table data. Is there...

Form Data Not Being Sent In ColdFusion

forms,coldfusion
I am trying to study ColdFusion (just starting out) and got stuck while doing some testing. Basically, I am trying to pass data from form.cfm to storage.cfm. However, the data does not seem to get passed/sent. Here is form.cfm (please ignore the markup, this is only for testing and I...

Date Picker format vs Database timestamp

sql-server,date,coldfusion
Is it possible to compare two dates if they are formatted in different ways? One date is coming from a ColdFusion UI input which is in the following format: mm/dd/yyyy My timestamp in my MSSQL database is in the following format: yyyy/mm/dd Background: I need to write a query that...

How to check at least 1 check box is check before submitting form? [duplicate]

coldfusion
This question already has an answer here: Making sure at least one checkbox is checked 3 answers I have a form which is outputting a number of checkbox. The form is working well when I have atleast 1 checkbox check. I would like to show an alert message is...

ColdFusion Builder 3 vs. Dreamweaver & local and remote paths

eclipse,iis,coldfusion,development-environment
I can't wrap my head around how I'm supposed to use ColdFusion Builder 3 (akin to Eclipse). Up until this point, I've been using Dreamweaver 5, which is getting 'long-in-the-tooth', and I wanted to give CF Builder a try. So, in Dreamweaver, it's pretty simple: you setup connections to servers...

Can I Use the same certificate for Token Security and Protocol Security in SAML2?

java,coldfusion,coldfusion-11,saml2
Can I use the same certificate issued by a certificate authority to sign the security token of SAML assertion and also for HTTPS SSL on IIS? I am using ColdFusion to create the SAML Response and used Java Keytool to create the certifcate....

CFPDF with PNG: transparency is black. With PDF it's white

pdf,coldfusion,thumbnails,watermark,cfpdf
I am trying to add a watermark to a PDF with a PNG file that has a transparent background. Every time I create the watermark it comes out as black background. When it comes to using a PDF as the watermark I get a white background of the watermark. Also,...

Data Link Escapes and Other Nonprintable Characters

coldfusion,sublimetext3,control-characters
In a while going through a .cfc file with a sublime text editor, I noticed that 3 characters in a string were highlighted. These characters were "DLE", and the group was treated as one character. I cannot highlight one without highlighting all of them. After doing some research, I believe...

How to remove � in Coldfusion JSON?

json,coldfusion
When I create JSON feed and output it in browser, I don't know why that character � coming up in every single character? {"members": [ {"user":"���d���e���8���8���f���5���c���7���3���7���1���4���7���6���6���f", "username":"���P���P���S���h���e���i���n", "avatar":"���m���a���l���e���.���p���n���g"} ]} Here is my Coldfusion coding, <cfcontent...

SublimeText 3 - Package Control: Removed directory for orphaned package ColdFusion

coldfusion,sublimetext3,sublimetext,sublime-text-plugin
I am running SublimeText 3 (build 3083). I follow the manual install directions for the ColdFusion plugin as described here (https://github.com/SublimeText/ColdFusion): Download Manually Download the files using the GitHub .zip download option Unzip the files and rename the folder to ColdFusion Copy the folder to your Sublime Text 2 Packages...

Parameterize ORM query with where in clause

hibernate,orm,coldfusion
I'm trying to parametrize a query that is currently working and is ripe for an SQL injection attack: qryAwards = ORMExecuteQuery( "from Award where awardID in (#form.deleteAwardList#) and Game.Season.User.userID=:uid", {uid=session.userID} ); if(not isNull(qryAwards) and arrayLen(qryAwards)){ for(i in qryAwards){ entityDelete(i); } } I tried this, having the param without single quotes:...

Change the List delimiter to something new

coldfusion
I am trying to change the delimiters of a list. So far I have been successful, but am losing ground on one of the actions. The issue is the with the last element, which is v. The code never appends ="" to the last element. It should not add a...

Can I specify a dynamic datasource at runtime?

coldfusion,coldfusion-11
My application is hosted on a central server which serves many customers. It now needs to cross-reference information with the database servers that reside onsite at the customer's location. I want to store the details of the customer's server alongside their account details (e.g dbname, host, port etc). However depending...

Get count of specifc rows returned in cfquery

sql-server,coldfusion,cfquery
I know you can get the count of how many items are returned in your query but... Question: Is it possible to get a recordcount of rows with a specific value for example... <cfset totalReturned = myquery.recordcount> <cfset totalReturnedComplete = myquery.recordcount (where status = "Complete")> I know the above will...

Use java class in ColdFusion11 - The java object type is unknown for the CreateObject function

coldfusion,coldfusion-10,railo,cfwheels
I have some code which works under Railo, but am trying to get this particular app working on CF10 and CF11 It's a cfWheels app, and I've got a BCrypt.class file in the /miscellaneous/ directory. In my /events/onapplicationstart.cfm file, I've got: application.bCrypt = CreateObject( "java", "BCrypt", "/miscellaneous/" ); This works...

Confusion on when to use cfoutput in cfmail

coldfusion,cfoutput
I am not 100% on when to use cfoutput and how cfoutput can be used in the following example. Should the whole cfmail be wrapped in a cfoutput? Background: I have a function that sends an email based on an if statement. The message of the email has variables that...

Fusebox cannot identify the controller

coldfusion,cfml,railo,cfc,fusebox
I am creating a fusebox application in Fusebox 5. It is working fine in my local. When I try it in a railo server, it throws an error like Attempting to execute the parsed file 'MyController.main.cfm' threw an error. This can occur if the parsed file does not exist in...

How can I escape commas inside listQualify function?

sql,coldfusion
I am a newbie at coldfusion. I need some help. My database has records that are company names as such: abc, Inc. For now I am using this query: SELECT DISTINCT COMPANY FROM ComapanyTable WHERE (Company IN (#ListQualify(form.cCompanyList2, "'", ",")#)) This problem with this is that it separates the abc,...

ColdFusion: Query VS Structures

performance,optimization,coldfusion,structure,cfquery
Currently, I've a query inside a loop as below. <cfloop query="Superquery"> <cfquery datasource="mysource" name="getData"> SELECT col1, Col2 FROM myData where col1 = #Superquery.IDCol# </cfquery> <!--- Some Processing ---> </cfloop> The query doesn't return much data. In some cases, it returns less than 100 rows & in some it can return...

How to identifiy date string vs date object

coldfusion,coldfusion-10
In CF10, how can I identify whether an object is a date string or a date object? myDateString = '2015-05-05'; myDateObject = createDate( 2015, 5, 5 ); I have tried isDate(), isValid( 'date' ), isValid( 'string'). All these functions give the same answers ('YES') to both variables. However, lsParseDateTime( myDateObject...

SessionTimeout not overrriding CF Administrator

coldfusion
I've got a website with a simple login. After 20 minutes, if the user has been inactive, his session expires, and if he tries to save his work (usually a book review that takes longer than 20 minutes to complete), he's logged out and loses everything. The code is six...

SQL ID from table posts same ID to all other coldfusion entries per transaction

sql-server,coldfusion
How do I trigger my ID from my Transaction table to be the same on all entries to each table per session? I am trying to insert a lot of information to many tables but trying to keep all tables linked together by TransactionID and am struggling on how it...

Read substring between two strings CF

regex,coldfusion,coldfusion-9
In an HTML file, I need to extract the date string between two substrings. Example string : <A HREF="actuals_ADAPS_20150517_3.txt"></A> <A HREF="actuals_ADAPS_20150517_3.txt">actuals_ADAPS_20150517_3.t&gt;</A> May 17 00:50 4k <A HREF="actuals_ADAPS_20150518_1.txt"></A> <A HREF="actuals_ADAPS_20150518_1.txt">actuals_ADAPS_20150518_1.t&gt;</A> May 17 18:50 4k <A HREF="actuals_ADAPS_20150518_3.txt"></A> <A...

How to write Russian characters to file with cffile

coldfusion,io,character-encoding,coldfusion-10
I have a string I need to write to create an XML file. The string has Russian characters in it, which I can cfoutput to the page no problem, but when I write the file with cffile, those characters return with a ?. I tried changing the charset to the...

Exact string coldfusion regular expression

regex,coldfusion
I am using a regular expression to replace all characters that are not equal to the exact word "NULL" and also keep all digits. I did a first step, by replacing all "NULL" words from my string with this : <cfset data = ReReplaceNoCase("123NjyfjUghfLL|NULL|NULL|NULL","\bNULL\b","","ALL")> It removes all instances of the...

Display single digits with leading zero

coldfusion
I am trying to make a minutes dropdown. How do I make it come out as 01, 02, 03, 04, 05, 06, 07 08, 09, 10, 11, 12, etc.? Right now the first 9 numbers only come out as 1, 2, 3, 4, 5, 6, 7, 8, 9. <select id="minutes">...

ColdFusion cfmail how do I keep the formatting

email,coldfusion
In my ColdFusion program I create email (HTML/CSS) for one or many recipients, and place it in a .cfm file. The email is nicely formatted. When I run the saved file as a program, the cfmail tag sends the email along to whomever, and that is all working. However, along...