coldfusion

cfhttp Passing POST variables via a link that is clicked?

夙愿已清 提交于 2019-12-24 10:36:45
问题 I was looking at the cfhttp tag and it is possible to use it to pass variables via clicked link? <cfhttp method="Post" url="myurl"> I am trying to pass variables on a link click (for example, user IDs), but it seems a bit insecure to send via GET... 回答1: My original answer completely missed the mark, but I can't delete an accepted answer, so for the purposes of clarity, I'm changing this answer to agree with Billy's comment above. CFHTTP is for making a server-side request to another website

Exporting from ColdFusion to Excel, how to modify Page Setup?

落花浮王杯 提交于 2019-12-24 10:08:32
问题 I'm exporting from ColdFusion 9 to Excel and I want to set the page orientation and scaling so the exported excel document fits to page and prints landscape. How to accomplish this? Edit with solution: Thanks for the assistance. The page-orientation setting worked as advertised. I used the following hack to get it to fit to page width. This page contains documentation on the various settings that are possible: http://msdn.microsoft.com/en-us/library/Aa155477%28office.10%29.aspx <cfheader name

EWS API and ColdFusion: How to reference returned values

こ雲淡風輕ζ 提交于 2019-12-24 08:49:13
问题 I am having difficulty working with complex arrays and could use some help. I am working with the EWS API to integrate mail functions with Exchange 2010 and CF. The code below connects to a mailbox that the primary account has delegated authority to. I want to return a list of messages in the inbox and work with the values that EWS returns (subject line, body, from, to, etc). I have not worked with complex arrays like this before, so I'm confused about how to reference the values returned,

ColdFusion - Date and Time formatting is rounding up 5 minutes

心已入冬 提交于 2019-12-24 08:47:00
问题 I have the following date string: 2017-05-02 08:00:00.0 When I apply datetimeformat() like: #datetimeformat(item.getValue('releasedate'), 'h:mm a')# It is rounding up by 5 minutes and outputting: 8:05 AM. In the code above, 'releasedate' is the string that is being passed in. How do I fix this? 回答1: Nobody is rounding anything. You are outputting the month here instead of the minutes, and the month happens to be May, so that is 05 with leading zero. https://cfdocs.org/datetimeformat: mm :

Images in rss feed using ColdFusion and CFFeed

喜欢而已 提交于 2019-12-24 08:44:17
问题 I have a script that generates an xml file with ColdFusion and its CFFeed tag. It works pretty good except for images. I understand that you have to use encapsulate the image in CDATA in order to display it. I am not sure if I have set it up correctly because the images are not showing up in my Google Reader / Feedly feed. Here is the code: <cfquery datasource="data" name="queryT"> SELECT * FROM qTable WHERE ... ORDER BY... </cfquery> <cfset RssStruct = StructNew() /> <cfset RssStruct.link =

Should I always need to use cflock with SESSION scope variables?

大城市里の小女人 提交于 2019-12-24 08:39:31
问题 I have a simple Form , which on submission sets a variable in SESSION like <cfset SESSION.shownote = 1> After firing an confirmation Email to the user , I am just deleting this variable from the Session. <cfset structdelete(SESSION,"shownote")> Do I really need to user cflock in this case ? I can not think of a Race condition here. As SESSION varies from one user to another , Can anyone please suggest me exactly on which situation we should use cflock with session variables? I have also heard

Getting distinct values in a column in orm

五迷三道 提交于 2019-12-24 08:12:36
问题 I can pull data via <cfquery name="keyTypeGroup"> SELECT DISTINCT keyTypeGroup FROM data.keyType </cfquery> I can pull all the data via orm ... return EntityLoad("data_KeyType"); ... I have tied <cfdump var="#ORMExecuteQuery('SELECT DISTINCT KeyGroupType FROM data.KeyType', true)#"> But I get Error while executing the Hibernate query. org.hibernate.hql.ast.QuerySyntaxException: data.KeyType is not mapped [SELECT DISTINCT KeyGroupType FROM data.KeyType] How should I approach fixing this? 回答1:

Square API and ColdFusion

我的未来我决定 提交于 2019-12-24 08:02:16
问题 I am trying to take an existing ColdFusion website that currently uses Authorize to process cards. I would like to switch over the payment gateway and use Square. Does anyone have any sample ColdFusion code on how to use the Square API as a payment gateway? 回答1: Here is a gist another developer has used <cfset IDKey = CreateUUID()> <cfset request.params.card_nonce = form.nonce> <cfset request.params.amount_money.amount = 100> <cfset request.params.amount_money.currency = 'USD'> <cfset request

Images from outside wwwroot not displaying (despite mapping)

蓝咒 提交于 2019-12-24 07:58:24
问题 In my ColdFusion application, I want to keep the images outside of wwwroot in this folder: C:\extSite\stdImages I created a mapping in wwwroot\WEB-INF\jrun-web.xml like this: <virtual-mapping> <resource-path>/extStdImages</resource-path> <system-path>C:\extSite\stdImages\</system-path> </virtual-mapping> To display an image, I do this: <img src="/extStdImages/abc.jpg"> This works fine on my dev site (which is using ColdFusion's built-in web server), but the image does not display in

ColdFusion: No data was received in the uploaded file

馋奶兔 提交于 2019-12-24 07:15:26
问题 My error report told me that an error has occurred when an user tried uploading an empty file to my server (don't ask why the user did that - I don't know) and now I want to catch that exception which said " No data was received in the uploaded file ". I wonder if there is a better way than putting a <CFTRY> around the <CFFILE action="upload"> like this: <CFTRY> <CFFILE action="upload" destination="#expandpath("upload")#" filefield="form.file" nameconflict="makeunique" /> <CFCATCH> <!---