Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all 14291 articles
Browse latest View live

How to open and read JSON file?

$
0
0

Is there a specific way to open and read a json file other than using cfhttp tag?


Download ColdFusion 11 developer edition

cf 2016 serving upto 64k of pdf

$
0
0

Hello Anyone,

Respectfully request help in this particular matter, here is my situation:

 

Production Environment:  Windows Server 2008 R2 Standard, IIS7, CF 9 using the following tags:

 

<cfheader Name="content-disposition" value="attachment; filename=#GetCustPdf.TheStatementFileName#">

        <cfcontent type="application/pdf" variable="#GetCustPdf.TheStatement#">

 

every pdf is served up correctly and views properly in any pdf reader.

 

Upgrade Environment:  Windows Server 2012 R2, IIS8, CF 2016 using the same tags:

 

<cfheader Name="content-disposition" value="attachment; filename=#GetCustPdf.TheStatementFileName#">

        <cfcontent type="application/pdf" variable="#GetCustPdf.TheStatement#">

 

every pdf over 64k is served up corrupted and does not view at all in any pdf reader.

 

I added this tag to check for corruption:

 

       <cffile action="write" output="#GetCustPdf.TheStatement#" file="c:\#GetCustPdf.TheStatementFileName#">

 

the local file is corrupted and not viewable and has a byte count of 64k.

the database field has the correct datalength which is always over 64k for those in question and has been verified on both environments.

 

Any help, education is greatly appreciated.

 

Richard

Pass ColdFusion variable to the JavaScript window

$
0
0

Hi everyone,

 

I have a java script window that is will open when user click on the link, my problem is that how I can pass a ColdFusion variable to the window. I am using ColdFusion 7 so I can not use cfwindow.what shold I put on the *** place??? I tried to put EntityId in the call place javascript:poponload(EntityId );   and function poponload(EntityId ), doesn’t 't work either so please let me know if you know how to do this.

 

My code:

 

<SCRIPT language="javascript">

function poponload()

{

window.open ('test.cfm?test='*** ,'mywindow','menubar=1,resizable=1,width=350,height=250');

}

</SCRIPT>

 

<body>

<cfform>

<cfset EntityId ="#form.EntityId#"> /I want to pass EntityId  to the javascript window

</cfif>

<a href="javascript:poponload();">Find IDs</a>

</cfform>

</body>

How to prevent clickjacking issue in CF

$
0
0

I created a cfm template with below contents to test clickjacking issue.

 

<html>

<head>

<title>Clickjack test page</title>

</head>

<body>

<p>Website is vulnerable to clickjacking!</p>

<iframe src="https://abcd.rw.xyz.com/mer/nao/app_v4/" width="500" height="500"></iframe>

</body>

</html>

 

And when I executed this template I was able to click on the "iframe" part. Which indicates that there is a clickjacking issue.Right??.

 

Is there any way to prevent clickjacking issue via CF admin/application code.

javax.mail.internet.AddressException: Empty address in string ``''

$
0
0

Hello all,

CF 2018 Standard on Windows 2016.

 

Running the following code:

<cfmail to="epipko@unionbay.com" from="mail@cf_server.com" subject="Example email">  Your Email Message!!!</cfmail>

 

Getting the following error in mail log:

javax.mail.internet.AddressException: Empty address in string ``''

 

If you dealt with this error before, please point me to the right direction to resolve it.

 

Thanks,

Eugene

Transfer an indexed collection

$
0
0

I have many thousands of PDF's organized into ~20 collections. To speed up indexing these, can I index them on a staging server and copy the collection data to a production box and have them available to the production application?

 

Where is the data about the collection stored?

I tried to copy the folder that contains the conf and data directories and the name, size and path show up on the Coldfusion collections page within the admin but the documents and last modified columns are empty.

Redirect page with custom header.

$
0
0

Hi All,

How can I pass a custom header while doing a permanent redirect?

mySite.mycloud.com is expecting a header for login validation.

Code for myFile.cfm

      <cfheader statuscode="301" statustext="Moved Permanently">

      <cfheader name="App-User-Header" value="#userId#">

      <cfheader name="Location" value="https://mySite.mycloud.com/cf">

Passing my userId as /myFile?userId=myuser, the userId is passing.

It is not showing the site as cflocation. Also the custom header doesn't show in browser dev tools.

Any ideas how to do this?


structKeyExists() vs IsDefined()

$
0
0


On a self submitting form (like a Contact Us)...

 

Why is <cfif structKeyExists(form, "submitform")> preferred over <cfif IsDefined('FORM.submitform')>?

 

What is the advantage/benefit of structKeyExists?

 

 

 

Thanks

How to Set up HTTPOnly and SECURE FLAG for session cookies

$
0
0

Hi All,

 

To fix some vulnerability issues (found in the ethical hacking , penetration testing) I need to set up the session cookies (CFID , CFTOKEN , JSESSIONID) with "HTTPOnly" (so not to access by other non HTTP APIs like Javascript). Also I need to set up a "secure flag" for those session cookies.

 

I have found the below solutions.

 

For setting up the HTTPOnly for the session cookies.

1] In application.cfc we can do this by using the below code. Or we can do this in CF admin side under Server Settings » Memory Variables

     this.sessioncookie.httponly = true;

 

For setting up the secure flag for the session cookies.

 

2] In application.cfc we can do this by using the below code. Or we can do this in CF admin side under Server Settings » Memory Variables

     this.sessioncookie.secure = "true"

 

 

Here my question is how we can do the same thing in Application.cfm?. (I am using ColdFusion version 10). I know we can do this using the below code , incase of HTTPOnly (for example).

 

<cfapplication setclientcookies="false" sessionmanagement="true" name="test">

<cfif NOT IsDefined("cookie.cfid") OR NOT IsDefined("cookie.cftoken") OR cookie.cftoken IS NOT session.CFToken>

  <cfheader name="Set-Cookie" value="CFID=#session.CFID#;path=/;HTTPOnly">

  <cfheader name="Set-Cookie" value="CFTOKEN=#session.CFTOKEN#;path=/;HTTPOnly">

</cfif>

 

But in the above code "setclientcookies" has been set to "false". In my application (it is an existing application) this has already been set to "true". If I change this to "false" as mentioned in the above code then ColdFusion will not automatically send CFID and CFTOKEN cookies to client browser and we need to manually code CFID and CFTOKEN on the URL for every page that uses Session. Right???. And this will be headache.Right???. Or any other way to do this.

 

Your timely help is well appreciated.

 

Thanks in advance.

COLDFUSION 9 FOR COLDFUSION 2018 STD

$
0
0

Good morning everyone.

Is version 9 compatible with version 2018? Will all 9 function tags work in 2018?
application.cfm will also run?

CF 10 JVM 1.8 not sending TLSV1.2 email to Office 365

$
0
0

I have a CF10 server running on Windows 2008 r2. JVM is 1.80_91. I have configured the Mail settings in CFAdmin to our Office 365 instance, I have a relay account we are using configured. When I send test emails they are only TLSv1.0 to Office365. I read a couple of forums and found the Dhttps settings which I have put into Java and JVM in CFAdmin. I restart the CF service and still the test messages are TLSv1.0. I even went into the javacpl.exe and unchecked TLS 1.0 and TLS 1.1 in Advanced.

 

What am I missing? Based on what I have been reading, this should work correctly.

com.sun.mail.smtp.SMTPSendFailedException: [EOF]

$
0
0

We are seeing this error since going to ColdFusion 10 enterprise. We have installed all the updates. Server is Windows 2008 64-bit with all the latest updates applied.

 

This appears to be very random, but it is causing some headaches with the mail spool. If 10 emails are in the queue, 9 will go out and 1 will go to undelivr even though all the parameters are the same. We move the file back to the spool and it goes through.

 

Right now I am dedicating a resource to monitor the spool so all emails go out (we send out hundreds per day from our app) but we need some type of resolution. Any help is appreciated!

Microsoft login to my website

$
0
0

I have been given the task of allowing users to login to our company's site if they are logged into their Microsoft account.

 

I have ZERO idea where to even begin with this.  I tried creating a new application in Azure and doing all the steps that they recommend and that just basically tells me that only I am logged in and doesn't do much else besides that so ColdFusion never kicks in.  Anyone else from the office gets an error saying they can't login.  I have been able to do a 'Sign in with Google' button before and with a few little tweaks in code can get it to read but Microsoft just seems like a whole other animal.

 

Has anyone been able to successfully been able to allow users logged into their Microsoft account been able to allow access to their website?  Then I have the daunting task of making sure that the person's email from Microsoft is allowed into our site.  Please help!!!

real use of CFID and CFTOKEN

$
0
0

Hi All,

 

Normally if a request is going to a CF server then the server wil generate two tokens CFID (say 100) and CFTOKEN (say 200) and this save as session cookies in broweser. This mechanism is for maintaining a session. And now if the session got expired , say after 20 mints , then the server will generate new tokens(say 300 and 400). This is how a CF session management is working , if I am not wrong.

 

I think in most of the cases we are not using the generated token(CFID and CFTOKEN) in our cfm or cfc code , atleast I didnt use. So my question is what is the real use of CFID and CFTOKEN untill and unless we are using those tokens while coding??. These questions arised in my mind when I was fixing some vulnerability issues as part of PCI scan where I had to secure session cookies. So I was thinking like was it really necessary to secure those session cookies as we are not using those cookies anywhere in our application rather those cookies are just used for session management.Or what an hacker can do if he/she is able to steal those cookies.

 

Any thoughts on this.


How can ı start program

$
0
0

Hello,

 

I set up coldfusıon 2018 and connected the admin server.everything is looking okey.But ı dont understand that when ı wrıte the programs,where ı can see the run ?ı used 127.0.0.1(localhost).Do ı need notepad or?

 

thanks.

How to retrieve fields value from Kendo Grid Models

$
0
0

Hi i want to retrieve fields value from Kendo Grid Models...

I try to get it but not retrieve records in the Kendo.....Bellow is my code:

Service.cfc

component

{

  remote string function JsonRead() returnFormat="plain" output="false"

  {

  q = new Query();

  q.setdataSource("TestingDataSource");

  q.setsql("SELECT * FROM Product");

  qResult = q.execute().getresult();

  return serializeJSON(queryToStruct(qResult));

  }

  struct function queryToStruct(required query data) output="false"

  {

  result = {};

  columns = listToArray(arguments.data.columnList);

 

  for(r = 1; r <= arguments.data.recordCount; r++)

  {

  row = {};

 

  for(c = 1; c <= arrayLen(columns); c++)

  {

  columnName = columns[c];

  structInsert(row, columnName, arguments.data[columnName][r]);

  }

 

  structInsert(result, r, row);

  }

 

  if(structCount(result) == 1)

  {

  result = result[structKeyArray(result)[1]];

  }

  return result;

  }

}

index.xfm

<!DOCTYPE html>

<html>

  <head>

  <title>

  Untitled Document

  </title>

  <script src="Scripts/jquery-1.10.2.js">

  </script>

  <script src="Scripts/jquery-ui.js">

  </script>

  <script src="Scripts/kendo.all.min.js">

  </script>

  <link href="Styles/jquery-ui.css" type="text/css" rel="stylesheet">

  <link href="Styles/kendo.common.min.css" type="text/css" rel="stylesheet">

  <link href="Styles/kendo.default.min.css" type="text/css" rel="stylesheet">

  </head>

  <body>

  <div id="grid">

  </div>

  <span id="loadLink">

  Load Query

  </span>

  <script>

  debugger;

  $("#loadLink").click(function(e){

        var serviceURL = "Component/Service.cfc?method=",

        dataSource = new kendo.data.DataSource({

         transport: {

     

             read: {

              type: "POST",

                 url: serviceURL + "JsonRead",

                 dataType: "JSON"

             },

          parameterMap: function(options, operation)

  {

                if (operation !== "read" && options.models)

  {

                    return {models: kendo.stringify(options.models)};

                }

            }

         },

     

         batch: true

     });

 

     $("#grid").kendoGrid({

         dataSource: dataSource,

         pageable: true,

         height: 430,

         toolbar: ["create"],

         columns: [{

             field: "ProductId",

             title: "ProductId",

             format: "{0:c}",

             width: "100px"

         }, {

             field: "ProductCategory",

             title: "ProductCategory",

             width: "100px"

         }, {

             field: "ProductName",

             width: "100px"

         }, {

             command: ["edit", "destroy"],

             title: " ",

             width: "172px"

         }],

         editable: "inline"

     });

  });

  </script>

  </body>

</html>

 

Message was edited by: Shraddha Prajapati

 

i got

serializeJSON(queryToStruct(qResult)) =   {"2":{"PRODUCTNAME":"2014 Chevrolet Cruze Diesel 4dr Sedan (2.0L 4cyl Turbodiesel 6A)","PRODUCTCATEGORYID":1,"PRODUCTID":2},"1":{"PRODUCTNAME":"2014 Kia Cadenza Premium 4dr Sedan (3.3L 6cyl 6A)","PRODUCTCATEGORYID":1,"PRODUCTID":1}}

 

But i want

serializeJSON(queryToStruct(qResult)) =   [{"ProductId":3,"ProductCategoryId":1,"ProductName":"2013 BMW M6 2dr Coupe (4.4L 8cyl Turbo 7AM)"},{"ProductId":12,"ProductCategoryId":1,"ProductName":"2013 Nissan GT-R Premium 2dr Coupe AWD (3.8L 6cyl Turbo 6AM)"}]

cfdocument type="pdf" Timeout

$
0
0

Where do I even start...

 

Scenario: I am the senior architect of multiple corporate .Net solutions.  Recently I decided to introduce ColdFusion11 to serve as a job server for background tasks (Scheduled ETL, Email Provider, Ad Hoc PDF generation and whatever other tasks we may wish to offload in a separate thread.) While I must admit, I stopped doing ColdFusion development some years ago; however, this does not negate the fact that I was an early adopter of ColdFusion and have well over 10 years of seasoned "in the trenches" experience with the language from the Alliare days, through the Macromedia days and into the Adobe days. Truth is - I have been a huge advocate of ColdFusion and implemented it many large corporations. Having said that -- I figured implementing a ColdFusion stack would be a cinch given my background. Unfortunately, this is not the case. I must say that some of the features I hoped to use (PDF & Web Services) are proving to be a big headache for me and I can't help but wonder if this is a wasted investment. I have to be honest - I am pretty disappointed in CF11.

 

Lets address the first issue. What is the problem with the cfdocument tag when writing PDF. I keep running into an issue where my CF pages timeout when writing PDF files. After doing some googling I find out this is an issue many are having and nobody really seems like they have a clue as to the root cause and Adobe is mute on the issue.  Before you ask me to post my code - please understand I timeout with <cfdocument ....>Hello World</cfdocument>. This is not a problem with my code (works fine locally w/Dev Edition - production is where it falls on it's face) - all I have done are basic query outputs with a single record in a query object and no images, no styles --- just basic HTML and cfoutput stuff. Restarting the coldfusion service seems to be the only fix. This is unacceptable.  I have since disabled the PDF Service Manager - it would not verify anyway (ColdFusion Service Features) -- perhaps this will prove to stabilize the issue. In any case - can someone on the Adobe CF Team explain to me why this problem is pervasive and what I can do to fix it, work around it and not just hope my job server doesn't have a random nervous breakdown.

 

Thank you for your time and effort

Coldfusion Future

$
0
0

My client is considering buying a system that is based on Coldfusion.

 

How should I evaluate whether this application has had the care and feeding necessary for it to be a healthy application with a future?

 

What is the future of Coldfusion in general?  Has Adobe published an official roadmap (I am not interested in seeing some blog)?

 

What are the license fees for an application deployed on a client site?

 

What are some of the dependencies installed on the host computer?  (installed on a windows computer)?

 

Are there RPA (robotic process automation) tools that work well with Coldfusion based web pages?

 

I am asking the vendor these same questions but I want to do my own independent research.

 

What other questions should I ask the vendor?

Can two IIS Websites with nearly Identical Code Basis be sent to the same ColdFusion Backend?

$
0
0

Running cold fusion standard, so i can only have 1 instance of the coldfusion tomcat host per machine.

https://helpx.adobe.com/coldfusion/configuring-administering/web-server-management.html#II S says it's fine to have two websites send over to the same isntance, but i was wondering if it's still fine if the two websites are almost exactly the same code base, same file names, etc. We were looking at this option to run two slightly different sites of the same server, aka only change a few files and let vhost routing make it so different users get different experience.

I understand double the load means double the resources for tomcat, but we you can assume it's properly sized. I'm just wondering if there are technical/concurrent problems with doing it this way.

 

For example one thing i'm concerned about is coldfusions compiler cache getting confused. If two sites have the same file with slightly different content, can it keep them straight? I'm guessing it's fine because i believe it's all checksum based on the hash of the cfm file (which is how changes to code work after the next refresh) but looking for some confirmation or anyone who has done something similar.

 

Or what about ColdFusion Help | Cache functions  would they collide across sites?

Viewing all 14291 articles
Browse latest View live