coldfusion

How to send email to recipient with umlauts in domain name?

。_饼干妹妹 提交于 2019-12-19 18:36:18
问题 In my app I have to send email to recipient who has umlauts in domain name. Example: "test@äöü.test.com" I'm using cfmail tag and I'm getting such error: "invalid definition for attribute to at tag mail" "Invalid E-Mail Address definition (test@äöü.test.com)" Is there any way to send email to such recipients in coldfusion? 回答1: There is even a easier solution! Why not use Oracles built in class: http://download.oracle.com/javase/6/docs/api/java/net/IDN.html#toUnicode(java.lang.String) Then

How do you redirect in ColdFusion and control the status code (i.e. 301 instead of a 302)

拈花ヽ惹草 提交于 2019-12-19 17:39:28
问题 This code does a redirect, but uses a 302 status code: <cflocation url="http://stackoverflow.com" addToken="no" /> I found this on the Internet, but I think it only works in ColdFusion8. I am using ColdFusion7. <cflocation url="http://stackoverflow.com" addToken="no" statuscode="301" /> Hoe do you control the status code in ColdFusion7? 回答1: <cfheader statuscode="301" statustext="Moved permanently"> <cfheader name="Location" value="http://stackoverflow.com"> 来源: https://stackoverflow.com

How to replace CR+LF with <br />?

人盡茶涼 提交于 2019-12-19 16:49:32
问题 For example: A user submits a form with a <textarea name="mytext" cols="35" rows="2"></textarea> and presses ENTER within it. How would I replace the CR-LF with a <br /> ? 回答1: CF has a function for this called ParagraphFormat(): <cfset form.userText = paragraphFormat(form.usertext)/> From the help docs - Replaces characters in a string: Single newline characters (CR/LF sequences) with spaces Double newline characters with HTML paragraph tags ( <p> ) It may do more than you want in that it

ColdFusion - Create Time from Number of Minutes

醉酒当歌 提交于 2019-12-19 16:47:26
问题 I have the number of minutes (ie. 25, 120, 300, etc) entered by the user, and I need to display it in a h:mm:ss format. Are there any built-in ColdFusion functions that can do this for me, or does anyone have any suggestions about the easiest way to build out the string? 回答1: <cfset totaltime = "#totalminutes\60#:#numberformat(totalminutes % 60, "00")#:00" /> 回答2: Kinda late to the game, but this works pretty nicely: TimeFormat(CreateTimeSpan(0,0,minutes,0)) 来源: https://stackoverflow.com

Is the “Maximum number of POST request parameters” limit trappable?

泪湿孤枕 提交于 2019-12-19 16:28:22
问题 Coldfusion 10 allows a limit to be set for the maximum number of POST request parameters (Server Settings / Settings / Request Size Limits / Maximum number of POST request parameters). The default limit is 100. Is it possible to trap when this limit has been exceeded so that it can be handled with a custom handler? If yes, how? I've tried to trap it with a site wide error handler and an onError() method in Application.cfc. Neither attempt was successful. Thanks for looking. 回答1: I can confirm

Error using Query Parameters with cfscript query

主宰稳场 提交于 2019-12-19 15:07:59
问题 Here is my code: var qryStr = " UPDATE templates_email SET title = :title, test_emails = :testEmail, body = :body WHERE id = :templateID"; q = New Query(); q.setSQL(qryStr); q.addParam(name="title", value="#arguments.title#", cfsqltype="cf_sql_char"); q.addParam(name="body", value="#arguments.templateContent#", cfsqltype="cf_sql_char"); q.addParam(name="testEmail", value="#arguments.test_emails#", cfsqltype="cf_sql_char"); q.addParam(name="templateID", value="#arguments.id#", cfsqltype="cf

Error using Query Parameters with cfscript query

二次信任 提交于 2019-12-19 15:07:24
问题 Here is my code: var qryStr = " UPDATE templates_email SET title = :title, test_emails = :testEmail, body = :body WHERE id = :templateID"; q = New Query(); q.setSQL(qryStr); q.addParam(name="title", value="#arguments.title#", cfsqltype="cf_sql_char"); q.addParam(name="body", value="#arguments.templateContent#", cfsqltype="cf_sql_char"); q.addParam(name="testEmail", value="#arguments.test_emails#", cfsqltype="cf_sql_char"); q.addParam(name="templateID", value="#arguments.id#", cfsqltype="cf

Does restarting CF server log everyone out?

拈花ヽ惹草 提交于 2019-12-19 11:56:39
问题 If CF server is restarted, are all the existing Session and Client variables lost? 回答1: Client variables generally live in a database or registry, and therefore they do persist after server restarts (see here). Session variables live in RAM and therefore do not persist through a server restart (see here). 来源: https://stackoverflow.com/questions/3233702/does-restarting-cf-server-log-everyone-out

creating multiple sheets using Coldfusion SpreadsheetWrite and cfscript

两盒软妹~` 提交于 2019-12-19 10:08:20
问题 I'd like to create a single excel file with two sheets using CF9, SpreadsheetWrite and cfscript. Something like: var data= spreadsheetNew( 'data' ); var key= spreadsheetNew( 'key'); spreadsheetAddRow( data, dataInfo ); spreadsheetAddRow( key, keyInfo ); spreadsheetWrite( data, filePath ); spreadsheetWrite( key, filePath ); I don't find documentation that explains how to combine multiple sheets in one file. Here's what I find. http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef

How to access a scope if its name is being used as a query column

╄→尐↘猪︶ㄣ 提交于 2019-12-19 09:49:57
问题 Dealing with some legacy code we came across a rather annoying situation. We are looping through a query with the <cfoutput query="x"> tag. That query has a column named 'url'. Within that loop we need to check if a key exists within the url scope. Since CF puts a priority on what's in the query over general page scopes I can't use a structKeyExists(url,"key") since as far as CF is concerned at this point, url is a string with the value from the current row of the query. How can I break out