Isstruct with cfcatch

I have passed 'cfcatch' to a function and checked the argument with isstruct() and it retrurn 'NO'. Why the isstruct return false
index.cfm
<cfoutput>
    <cftry>
        <cfset t.a="Dileep">
        #isstruct(t)#<br />
        #getStruct(t)#<br />
        #getStruct1(t)#<br />
        <cfcatch >
        <br />
        <cfdump var="#cfcatch#">
        #getStruct(cfcatch)#
        </cfcatch>
    </cftry>
</cfoutput>
<cffunction name="getStruct">
    <cfargument name="test">
    <cfreturn isstruct(test)>
</cffunction>
out put
YES
YES
struct
Detail
[empty string]
ErrNumber
0
Message
Variable GETSTRUCT1 is undefined.
StackTrace
coldfusion.runtime.UndefinedVariableException: Variable GETSTRUCT1 is undefined.      at coldfusion.runtime.CfJspPage._get(CfJspPage.java:325)      at coldfusion.runtime.CfJspPage._get(CfJspPage.java:287)      at cftest2ecfm1898925283.runPage(D:\Projects\Glasnost\Glasnost\Output\test.cfm:8)      at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)      at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)      at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)      at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:282)      at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)      at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)      at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)      at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)      at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)      at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)      at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)      at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)      at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)      at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)      at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)      at coldfusion.CfmServlet.service(CfmServlet.java:198)      at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)      at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)      at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 )      at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)      at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)      at jrun.servlet.FilterChain.service(FilterChain.java:101)      at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)      at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)      at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)      at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)      at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)      at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)      at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)      at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)      at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
TagContext
array
1
struct
COLUMN
0
ID
LINE
8
RAW_TRACE
at cftest2ecfm1898925283.runPage(D:\Projects\Glasnost\Glasnost\Output\test.cfm:8)
TEMPLATE
D:\Projects\Glasnost\Glasnost\Output\test.cfm
TYPE
CFML
Type
Expression
name
GETSTRUCT1
NO

OK. Thanks.
But while 'cfdump' shows header as 'struct'. Please see the attched image

Similar Messages

  • Cfcatch issue

    hi all-
    I am using try/catch around a cfquery, and when I use #cfcatch.SQl# within cfcatch, I get an error saying sql is undefined
    in cfcatch. The same happens with #cfcatch.where#. Everything is fine with #cfcatch.detail#, #cfcatch.message#.
    I have been working with #cfcatch.sql# and #cfcatch.where# with no issues until today. Can any one let me know what could be
    the issue

    Is it a DB exception being throw?  I can't say I've ever used either of cfcatch.sql or cfcatch.where (didn't even know they existed until now, so cheers for mentioning them!), but by my reading of the docs, those values are only available with DB exceptions.  So if you simply have a logic error which causes an exception in your code, be it within <cfquery> tags or not, they you'll not get those values available.  But like I said, this is speculation based on my reading of the docs, not any actual exposure to the situation.
    http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_c_04.html
    Adam

  • Catching java.lang.NullPointerException with cftry/cfcatch?

    I'm getting a java.lang.NullPointerException returned on an
    update function in a CFC:
    "The cause of this output exception was that:
    java.lang.NullPointerException."
    I want to find where it's generating this error so I can fix
    it. I've never really used CFTRY and CFCATCH, but figured now would
    be a good time to learn if this helped me track down the null. Can
    anyone provide an example of how to use these tags with the above
    NPE and output a message that give info on where it's faulting?
    I'm using a standard update query,
    <cfquery>
    UPDATE table
    SET columns = new values
    WHERE ID column = some ID
    </cfquery>

    That was a great tip Dan. Helped me find the line. Apparently
    a datatype "date" was given an incorrect null value. I figured the
    problem and the update works now :)
    Here's code incase someone wants to know:

  • Problem with return a ColdFusion query object from a Java class

    Hi!
    I need to return a ColdFusion query object from a Java class
    using a JDBC result set ( java.sql.ResultSet);
    I have tried to pass my JDBC result set in to the constructor
    of the coldfusion.sql.QueryTable class with this code:
    ColdFusion code
    <cfset pra = createObject("java","QueryUtil").init()>
    <cfset newQuery = CreateObject("java",
    "coldfusion.sql.QueryTable")>
    <cfset newQuery.init( pra.getColdFusionQuery () ) >
    My java class execute a query to db and return QueryTable
    Java code (QueryUtil.java)
    import coldfusion.sql.QueryTable; // (CFusion.jar for class
    QueryTable)
    import com.allaire.cfx //(cfx.jar for class Query used from
    QueryTable)
    public class QueryUtil
    public static coldfusion.sql.QueryTable
    getColdFusionQuery(java.sql.ResultSet rs)
    return new coldfusion.sql.QueryTable(rs);
    but when i run cfm page and coldfusion server tries to
    execute : "<cfset pra =
    createObject("java","QueryUtil").init()>" this error appears:
    Object Instantiation Exception.
    An exception occurred when instantiating a java object. The
    cause of this exception was that: coldfusion/sql/QueryTable.
    If i try to execute QueryUtil.java with Eclipse all it works.
    Also I have tried to return java.sql.ResultSet directly to
    coldfusion.sql.QueryTable.init () with failure.
    Do you know some other solution?

    ok
    i print all my code
    pratica.java execute a query to db and return a querytable
    java class
    import java.util.*;
    import java.sql.*;
    import coldfusion.sql.*;
    public class Pratica {
    private HashMap my;
    private String URI,LOGIN,PWD,DRIVER;
    private Connection conn=null;
    //funzione init
    //riceve due strutture converite in hashmap
    // globals
    // dbprop
    public Pratica(HashMap globals,HashMap dbprop) {
    my = new HashMap();
    my.put("GLOBALS",globals);
    my.put("DBPROP",dbprop);
    URI = "jdbc:sqlserver://it-bra-s0016;databaseName=nmobl";
    LOGIN = "usr_dev";
    PWD = "developer";
    DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
    try{
    // Carico il driver JDBC per la connessione con il database
    MySQL
    Class.forName(DRIVER);
    /* Connessione alla base di dati */
    conn=DriverManager.getConnection(URI,LOGIN,PWD);
    if(conn!=null) System.out.println("Connection Successful!");
    } catch (ClassNotFoundException e) {
    // Could not find the database driver
    System.out.print("\ndriver non trovato "+e.getMessage());
    System.out.flush();
    catch (SQLException e) {
    // Could not connect to the database
    System.out.print("\nConnessione fallita "+e.getMessage());
    System.out.flush();
    //funzione search
    //riceve un hash map con i filtri di ricerca
    public QueryTable search(/*HashMap arg*/) {
    ResultSet rs=null;
    Statement stmt=null;
    QueryTable ret=null;
    String query="SELECT * FROM TAN100pratiche";
    try{
    stmt = conn.createStatement();// Creo lo Statement per
    l'esecuzione della query
    rs=stmt.executeQuery(query);
    // while (rs.next()) {
    // System.out.println(rs.getString("descrizione"));
    catch (Exception e) {
    e.printStackTrace();
    try {
    ret = Pratica.RsToQueryTable(rs);
    } catch (SQLException e) {
    e.printStackTrace();
    this.close();
    return(ret);
    // ret=this.RsToQuery(rs);
    // this.close(); //chiude le connessioni,recordset e
    statament
    //retstruct CF vede HashMap come struct
    //METODO DI TEST
    public HashMap retstruct(){
    return(my);
    //conversione resultset to querytable
    private static QueryTable RsToQueryTable(ResultSet rs)
    throws SQLException{
    return new QueryTable(rs);
    //chiura resultset statament e connessione
    private void close(){
    try{
    conn.close();
    conn=null;
    catch (Exception e) {
    e.printStackTrace();
    coldfusion code
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN">
    <html>
    <head>
    <title>Test JDBC CFML Using CFScript</title>
    </head>
    <body>
    <cftry>
    <cfset glb_map =
    createObject("java","java.util.HashMap")>
    <cfset dbprop_map =
    createObject("java","java.util.HashMap")>
    <cfset glb_map.init(glb)> <!---are passed from
    another page--->
    <cfset dbprop_map.init(glb["DBPROP"])>
    <cfset pra =
    createObject("java","Pratica").init(glb_map,dbprop_map)>
    <cfset ourQuery
    =createObject("java","coldfusion.sql.QueryTable").init(pra.search())>
    <cfcatch>
    <h2>Error - info below</h2>
    <cfdump var="#cfcatch#"><cfabort>
    </cfcatch>
    </cftry>
    <h2>Success - statement dumped below</h2>
    <cfdump var="#ourQuery#">
    </body>
    </html>
    error at line <cfset pra =
    createObject("java","Pratica").init(glb_map,dbprop_map)>
    An exception occurred when instantiating a java object. The
    cause of this exception was that: coldfusion/sql/QueryTable.
    -----------------------------------------------------------------------

  • Problem with Multi File upload example, help needed

    I got the code from the following location.....
    http://www.adobe.com/devnet/coldfusion/articles/multifile_upload.html
    And I've got it to work to some degree except I cant get the file transfer to work when pressing, Upload.   Below is what my debugger outputs.  Any thoughts on how to fix this or even what it means?
    At the very bottom of this message is the upload.cfm code.......
    Thanks in advance for the help
    <html>
    <head>
      <title>Products - Error</title>
    </head>
    <body>
    <h2>Sorry</h2>
    <p>An error occurred when you requested this page.
    Please email the Webmaster to report this error.
    We will work to correct the problem and apologize
    for the inconvenience.</p>
    <table border=1>
    <tr><td><b>Error Information</b> <br>
      Date and time: 12/07/09 22:25:51 <br>
      Page:  <br>
      Remote Address: 67.170.79.241 <br>
      HTTP Referer: <br>
      Details: ColdFusion cannot determine how to process the tag &lt;CFDOCUMENT&gt;. The tag name may be misspelled.<p>If you are using tags whose names begin with CF but are not ColdFusion tags you should contact Allaire Support. <p>The error occurred while processing an element with a general identifier of (CFDOCUMENT), occupying document position (41:4) to (41:70).<p>The specific sequence of files included or processed is:<code><br><strong>D:\hshome\edejham7\edeweb.com\MultiFileUpload\upload.cfm      </strong></code><br>
      <br>
    </td></tr></table>
    </body>
    </html>
    <!---
    Flex Multi-File Upload Server Side File Handler
    This file is where the upload action from the Flex Multi-File Upload UI points.
    This is the handler the server side half of the upload process.
    --->
    <cftry>
    <!---
    Because flash uploads all files with a binary mime type ("application/ocet-stream") we cannot set cffile to accept specfic mime types.
    The workaround is to check the file type after it arrives on the server and if it is non desireable delete it.
    --->
        <cffile action="upload"
                filefield="filedata"
                destination="#ExpandPath('\')#MultiFileUpload\uploadedfiles\"
                nameconflict="makeunique"
                accept="application/octet-stream"/>
            <!--- Begin checking the file extension of uploaded files --->
            <cfset acceptedFileExtensions = "jpg,jpeg,gif,png,pdf,flv,txt,doc,rtf"/>
            <cfset filecheck = listFindNoCase(acceptedFileExtensions,File.ServerFileExt)/>
    <!---
    If the variable filecheck equals false delete the uploaded file immediatley as it does not match the desired file types
    --->
            <cfif filecheck eq false>
                <cffile action="delete" file="#ExpandPath('\')#MultiFileUpload\uploadedfiles\#File.ServerFile#"/>
            </cfif>
    <!---
    Should any error occur output a pdf with all the details.
    It is difficult to debug an error from this file because no debug information is
    diplayed on page as its called from within the Flash UI.  If your files are not uploading check
    to see if an errordebug.pdf has been generated.
    --->
            <cfcatch type="any">
                <cfdocument format="PDF" overwrite="yes" filename="errordebug.pdf">
                    <cfdump var="#cfcatch#"/>
                </cfdocument>
            </cfcatch>
    </cftry>

    Just 2 things in my test:
    1) I use no accept attribute. Coldfusion is then free to upload any extenstion.
    Restricting the type to application/octet-stream may generate errors. Also, it is unnecessary, because we perform a type check anyway.
    2) I have used #ExpandPath('.')#\ in place of #ExpandPath('\')#
    <cfif isdefined("form.filedata")>
    <cftry>
    <cffile action="upload"
                filefield="filedata"
                destination="#expandPath('.')#\MultiFileUpload\uploadedfiles\"
                nameconflict="makeunique">
            <!--- Begin checking the file extension of uploaded files --->
            <cfset acceptedFileExtensions = "jpg,jpeg,gif,png,pdf,flv,txt,doc,rtf"/>
            <cfset filecheck = listFindNoCase(acceptedFileExtensions,File.ServerFileExt)/>
    <!---
    If the variable filecheck equals false delete the uploaded file immediatley as it does not match the desired file types
    --->
            <cfif filecheck eq false>
                <cffile action="delete" file="#ExpandPath('.')#\MultiFileUpload\uploadedfiles\#File.ServerFile#"/>
                <cfoutput>Uploaded file deleted -- unacceptable extension (#ucase(File.ServerFileExt)#)</cfoutput>.<br>
            </cfif>
    Upload process done!
            <cfcatch type="any">
                There was an error!
                <cfdocument format="PDF" overwrite="yes" filename="errordebug.pdf">
                    <cfdump var="#cfcatch#"/>
                </cfdocument>
            </cfcatch>
    </cftry>
    <cfelse>
    <form method="post" action=<cfoutput>#cgi.script_name#</cfoutput>
            name="uploadForm" enctype="multipart/form-data">
            <input name="filedata" type="file">
            <br>
            <input name="submit" type="submit" value="Upload File">
        </form>
    </cfif>

  • Server side validation for file type with cffil sent via cfmail problem

    Hello;
    I have a small app that I need to allow users to be able to use a form, and send me and email with a file attachment. I have it working nicely, I included file manipulation into the validation process of the form and required form fields. The problem I'm having, is this. I'm trying to create and instance where if they try and upload lets say a pdf, it throws and error: "You are trying to upload the wrong file, please try again we only accept bla bla bla" Problem is, even if I'm uploading the proper file, it's rejecting it and deleting it. Can someone help me fix this? I've tried a number of different ways and can't seem to get this to go off properly. I am posting some of the code. There is a ton, so I'm posting the main parts so you get the idea and see my variables.
    <!--- Declairing my variables and setting up form validation--->
    <cfparam name="FORM.descript" type="string" default=""/>
    <cfparam name="FORM.attachment_1" type="string" default=""/>
    <cfset arrErrors = ArrayNew( 1 ) />
    <cfset showForm = true>
    <cfif structKeyExists(form, "sendcomments")>
    <cfif NOT len(trim(FORM.name))>
    <cfset ArrayAppend(arrErrors,"Your Full Name!<br>") />
    </cfif>
    <!--- This is where the file error control is as you can see how the name is validated, the file will be dealt with in a similar maner--->
    <cfif NOT Len(Trim(FORM.attachment_1))>
    <cfset ArrayAppend(arrErrors,"You didn't attach a file!<br>") />
    <cfelseif ArrayLen( arrErrors )>
    <cftry>
    <cffile action="DELETE" file="#FORM.resume#"/>
    <cfcatch>
    <!--- File delete error. --->
    </cfcatch>
    </cftry>
    <cfelse>
    <!--- no errors with the file upload so lets upload it--->
    <cftry>
    <cfset request.AcceptImage="image/gif,image/jpg,image/jpeg,image/pjpeg,image/x-png">
    <cffile action="upload"
                     filefield="attachment_1"
                     accept="#request.AcceptImage#"
                     destination="c:\websites\187914Kg3\uploads\"
                     nameconflict="Makeunique">
    <!---
    Now that we have the file uploaded, let's
    check the file extension. I find this to be
    better than checking the MIME type as that
    can be inaccurate (so can this, but at least
    it doesn't throw a ColdFusion error).
    --->
    <cfif NOT ListFindNoCase("request.AcceptImage",CFFILE.ServerFileExt)>
    <cfset ArrayAppend(arrErrors,"Only JPEG, GIF, and PNG file formats are accepted!<br>") />
    <!---
    Since this was not an acceptable file,
    let's delete the one that was uploaded.
    --->
    <cftry>
    <cffile action="DELETE" file="#CFFILE.ServerDirectory#\#CFFILE.ServerFile#"/>
    <cfcatch>
    <!--- File Delete Error. --->
    </cfcatch>
    </cftry>
    </cfif>
    <!--- This is the code that is causing my problem. The above code is saying everything is not the proper file and rejecting it all--->
    Can anyone help me out. I can make more of this code available if needed. Like i said, there's a lot and I didn't want to dump it all out, this is the section creating the problem. There are no errors at this time, just rejecting all file types.
    thank you.

    It appears you are comparing your content_length with 1MB.
    1KB: 1024 bytes
    1MB: 1024*1024 bytes
    Let us use max allowable size of 25KB here and amend the second half of our code.
    <!--- Set max allowable file size in KB at the top --->
    <cfset maxFileSize = 25>
          <!--- Check if file is an image file of acceptable size --->
          <cfif (#reFindNoCase("gif|jpg|jpeg|pjpeg|png",myResult.clientFileExt, 1)# EQ 1) AND (#myResult.FileSize# LTE (#maxFileSize#*1024))>
                <!--- Retain if right file type and size --->
                <p>
                Your file <strong>#myResult.clientFile#</strong> has been uploaded successfully!<br />
                <a href="yourTemplate.cfm">Back</a></p>
                <!--- Otherwise if wrong type --->
          <cfelseif #reFindNoCase("gif|jpg|jpeg|pjpeg|png",myResult.clientFileExt, 1)# NEQ 1>
                <p>
                You are trying to upload a <strong>#myResult.clientFileExt#</strong> file, please try again. We only accept <strong>gif, jpg, jpeg, and png</strong>.
                </p>
                <!--- Delete unacceptable file and show form to user to try again--->  
                <cffile action="delete"  file="#svrFile#" />
                      <form method="post" action=#cgi.script_name# 
                      name="uploadForm" enctype="multipart/form-data">
                      <input name="attachment_1" type="file">
                      <br>
                      <input name="submit" type="submit" value="Try again!">
                </form>
                <!--- Or size too large --->
          <cfelseif #myResult.FileSize# GT (#maxFileSize#*1024)>
                <p>
                Your file was too large (<strong>#numberFormat(myResult.fileSize/1024, "____.__")# KB</strong>). Please try a smaller file!
                </p>
                <!--- Delete file and show form--->
                <cffile action="delete"  file="#svrFile#" />
                      <form method="post" action=#cgi.script_name# 
                      name="uploadForm" enctype="multipart/form-data">
                      <input name="attachment_1" type="file">
                      <br>
                      <input name="submit" type="submit" value="Try again!">
                </form>
          </cfif>
    </cfif>        <!--- Closes the cfif tag which started from the first half --->
    </cfoutput><!--- ditto --->

  • Convert rtf to pdf with good font and sharp images

    I can convert rtf to pdf in Microsoft Word (2004) using the Print function but the resulting document doesn't maintain the same font and the images look a bit hinky as a result.
    I tried to convert from rtf to pdf in Acrobat 9 but it sez unsupported file type.
    I just want a really clean conversion that keeps the images sharp and the fonts looking good.  Am I out of luck?

    <!--- source:http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?cont ext=ColdFusion_Documentation&file=00001585.htm ---> 
    <cflock scope="Application" type="exclusive" timeout="120">
    <cfif not StructKeyExists(application, "MyWordObj")>
     <!--- First try to connect to an existing Word object --->  
    <cftry>
    <cfobject type="com"
    action="connect"
    class="Word.application"
    name="Application.MyWordobj"
    context="local">  
    <cfcatch>
    <!--- There is no existing object, create one --->  
    <cfobject type="com"
    action="Create"
    class="Word.application"
    name="Application.MyWordobj"
    context="local">  
    </cfcatch>
    </cftry>
    <cfset Application.mywordobj.visible = False>
    </cfif>
    </cflock>
     <!--- Convert a Word document in temp.doc to an HTML file in temp.htm. --->
    <!--- Because this example uses a fixed filename, multiple pages might try
    to use the file simultaneously. The lock ensures that all actions from
    reading the input file through closing the output file are a single "atomic"
    operation, and the next page cannot access the file until the current page
    completes all processing.
    Use a named lock instead of the Application scope lock to reduce lock contention. ---><cflock 
    name="WordObjLock" type="exclusive" timeout="120">
    <cfset docs = application.mywordobj.documents()>
    <cfset docs.open("c:\ColdFusion8\wwwroot\RTFtoPDF\temp.rtf")>
    <cfset converteddoc = application.mywordobj.activedocument>
    <!--- Val(8) works with Word 2000. Use Val(10) for Word 97 --->
    <cfset converteddoc.saveas("c:\ColdFusion8\wwwroot\RTFtoPDF\temp.htm",val(8))>
    <cfset converteddoc.close()></cflock>
    <!--- Read the HTML file ---><cffile 
    action="read" file="#expandPath('temp.htm')#" variable="fileToConvert">
    <!--- Convert from HTML to PDF---><cfdocument 
    overwrite="yes" filename="#expandPath('temp.pdf')#" format="PDF"><cfoutput>#fileToConvert#</cfoutput></cfdocument>
    <p>Conversion from temp.rtf to temp.pdf complete</p>

  • How to get a file with CFFTP

    I am trying to grab a file and move it to the coldfusion server using <CFFTP> The server in which I am trying to grab the file is a sftp server. I am running coldfusion 8. When I run my code, I dont get an error, I just get a blank white screen, yet the file has not been moved. I will post my code below, does anyone know what I am doing wrong?
    <!--- Open conncetion with remote sftpserver --->
            <cftry>
                <cfftp action="open"
                    connection="ftpServer"
                    server="server.com"
                    username = "username"
                    password = "password"
                    fingerprint = "11:11:B5:F2:11:AF:C2:E2:31:11:D3:B4:11:83:11:11"
                    timeout="20"
                    port="22"
                    secure = "yes" />
                <cfcatch>
                    <cfset throwFileTransferFailed("Could not open connection. Message: " & cfcatch.Message & ". Detail: " & cfcatch.Detail)>
                </cfcatch>
            </cftry>
    <!--- get the file --->
            <cftry>     
                   <cfftp
                    action="getFile"
                    connection="ftpServer"
                    server="server.com"
                    username="username"
                    password="password"
                    remotefile="TEST_20100816.csv"
                    localfile="C:\WENS_DEV\pdf\"
                    failIfExists="no">
                <cfcatch>
                    <cfset throwFileTransferFailed("Could not open connection. Message: " & cfcatch.Message & ". Detail: " & cfcatch.Detail)>
                </cfcatch>
            </cftry>

    how do I tellif the CF service has sufficient rights?
    Now my code looks like this and I am still getting an error. I cant figure it out.
                <cfftp action="open"
                    connection="ftpServer"
                    server="server.com"
                    username = "username"
                    password = "password"
                    fingerprint = "11:11:11:11:11:11:11:11:11"
                    timeout="30"
                    port="22"
                    secure = "yes" />
                   <cfftp
                    action="getFile"
                    connection="ftpServer"
                    remotefile="TEST_20100816.csv"
                    localfile="C:\WENS_DEV\pdf\TEST_20100816.csv"
                    failIfExists="no">

  • Simple file loader with cffile

    Hello;
    I'm trying to make a basic file loader for my web site. I've written the file upload, and it works. I'll attach that code. I was wondering if someone could help me over this small hurdle I need to get past... let me explain.
    I have an admin section in my web site. This file loader is to add new thumbnail images to a db record and show it on the front end. There is an option to either edit and existing record, or add a new record.
    When you get to the editor, I'm putting in a link for a pop up window that has this file loader in it. What I want to do it after you load this file, I need it to be able to close the window and add it to the editor section so the file name can be loaded into the database.
    Is this possible and kind of simple? I realize nothing is too simple doing this kind of programming, I'm just trying to find a decent solution that works. Maybe there is a tutorial out there for this kind of thing? Or maybe someone can help me with a couple lines of code so I can take it from there?
    This is my file loader:
    <cfset UploadFolder="c:\Inetpub\wwwroot\website\img\babies">
    <cfif IsDefined("Form.UploadFile") AND Form.UploadFile NEQ "">
    <cffile
         action="upload"
            filefield="UploadFile"
            destination="#UploadFolder#"
            nameconflict="overwrite"
            >
    File uploaded successfully!
        <br />
        Uploaded file: <cfoutput>#cffile.ClientFile#</cfoutput>
    <cfelse>
    Select a file first!       
    </cfif>
    <form name="UploadForm" method="post" enctype="multipart/form-data" action="">
    <input type="file" name="UploadFile">
        <input type="submit"  name="submit" value="Upload"/>
    </form>
    I can also post the db code for the page I'm loading it into if need be. I would have to refresh the page I believe to get the info from the pop up to the parent window that spawned it. I have a script for that:
    <a href="javascript:opener.top.location=('/test/edit-record.cfm');" onclick= "javascript:window.close();">close window</a>
    can anyone help me make this work properly? OR point me in a direction of a tutorial for a simple file loader of this type?
    thank you.

    I was wondering if Ajax would be a good solution. Can you tell me this
    ? I have a file loader I use all the time, but on this server, it's not working properly. Can you look at my code and possibly tell me why? I
    know this is a lot of code I'm pasting, but it is pretty strait forward. It doesn't thrown an error, it just doesn't load the file
    at all.
    I would rather use this, I have it all written:
    <!--- form submitted --->
    <!--- set file uploading vars --->
    <cfparam name="fileuploaded" type="boolean" default="false">
    <cfparam name="uploadedfile" default="">
    <cfset pathToFile = "c:\Inetpub\wwwroot\website\img\babies">
    <!--- --->
    <cfif len(trim(form.MYFile))>
    <!--- if a file has been selected --->
    <!--- try uploading new file --->
    <cftry>
    <cffile Action="upload" filefield="MYFile" accept="image/gif,
    image/jpg, image/jpeg, image/pjpeg"
    destination="#pathToFile#" nameconflict="MAKEUNIQUE">
    <cfset fileuploaded = true>
    <cfset uploadedfile = cffile.serverfile>
    <cfcatch type="any">
    <!--- if upload did not suceed, reset file uploading vars --->
    <cfset fileuploaded = false>
    <cfset uploadedfile = "">
    <!--- this can be further enhanced by setting some var to hold error
    message and return it to user --->
    </cfcatch>
    </cftry>
    </cfif>
    <cfif form.id gt 0><!--- we are updating an existing record --->
    <!--- if new file upload was successful and the feature has an image
    associated with it - delete old image --->
    <cfif fileuploaded is true AND len(trim(form.oldimage))>
    <cfif FileExists(pathToFile & form.oldimage)>
    <cffile action="delete" file="#pathToFile & form.oldimage#">
    </cfif>
    </cfif>
    <cfquery datasource="#APPLICATION.dataSource#">
    UPDATE baby_port
    SET
    baby_port.dob=<cfqueryparam cfsqltype="CF_SQL_DATE" value="#form.edit1#">,
    baby_port.Fname=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.Name#">,
    baby_port.Lname=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.Lname#">,
    <cfif fileuploaded is true>
    baby_port.MYFile=<cfqueryparam cfsqltype="cf_sql_varchar" value="#uploadedfile#">,
    </cfif>
    baby_port.Body=<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#form.PDSeditor#">,
    baby_port.weight=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.weight#">,
    baby_port.TimeB=<cfqueryparam cfsqltype="CF_SQL_TIME" value="#form.tob#">
    WHERE ID = <cfqueryparam value="#form.ID#" cfsqlType="CF_SQL_INTEGER">
    </cfquery>
    <cfelse><!--- we are inserting a new record --->
    <cfquery datasource="#APPLICATION.dataSource#">
    INSERT INTO baby_port
    (dob, Fname, Lname, MYFile, Body, weight, TimeB)
    VALUES
    (<cfqueryparam cfsqltype="CF_SQL_DATE" value="#form.edit1#">,
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.Name#">,
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.Lname#">,
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#uploadedfile#" null="#NOT fileuploaded#">,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#form.PDSeditor#">,
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.weight#">,
    <cfqueryparam cfsqltype="CF_SQL_TIME" value="#form.tob#">)
    </cfquery>
    </cfif>
    this is the 2 fields on the form that is submitting the file:
    <input type="hidden" name="oldimage" value="#MYFile#">
    <input name="MYFile" type="file" id="MYFile">
    I can make more available if you need it, I didn't want to unload a ton of code on you.This is a stand alone server running coldfusion 8.1 standard if that makes a difference, it is not a shared environment. I have this code working on shared environments.

  • Moving to CF10, Need help with Application.cfc

    I've been googling about how to work with Application.cfc since last week but I still have some questions and I can't find the answers.
    My application is under the root (in unix) and there are many subfolders underneath it. Each sub-folder is hosting a different web application.
    From what I read, I can create 1 root Application.cfc and then on subsequent sub-folder, when I need to have another Application.cfc on that level, I can create ProxyApplication (see below) and then create a sub-folder level Applicatin.cfc
    So, when I set an application.DSN on my root Application.cfc, using proxyApplication I don't have to reset this dsn again in my sub folder level Application.cfc
    Since my loginform.cfm and loginaction.cfm is right under root directory too,  I also set OnsessionStart in the root Application.cfc to handle user login. Then this means, I don't have to reset session variable again anywhere because session.username, etc has been set on the highest level.
    Is this correct?
    In addition, Am I correct when I do the following:
    1. Since I have root level and sub-folder level Application.cfc, I should set this.name with a different name, am I right?
        On the root Application.cfc I set this.name = "StudentServices" because this represent the global application
        On the sub-folder level's Application.cfc, I set this.name to "StudentServices_stdLoad" becaus this sub-folder only handle student load application.
    2. On the root Application.cfc, I set the DSN to the application scope. So on the sub-folder level Application.cfc I can check if a particular db is working or not
        because as awhole, in the global sense, this web application uses more than one Databases. Each sub-folder may use a database that is dfferent than the other sub folder.
    Am I doing the right thing? Please advice
    Below is example of what I have, Thank you!
    I created a root Application.cfc under the root directory: 
    <CFCOMPONENT displayname="Application" output="true" hint="My Root Application component">
       <!--- Set up the application --->    <cfset THIS.Name = "StudentServices" />    <cfset THIS.ApplicationTimeout = CreateTimeSpan(0,0,30,0) />    <cfset THIS.SessionManagement = true />    <cfset THIS.SetClientCookies = false />
           <cffunction name="OnApplicationStart" access="public" returntype="boolean" output="false">
       <cfset application.MainDSN = "DSN1">
       <cfset application.ReportDSN = "DSN2">
       <cfreturn true/>
    </cffunction>
     <cffunction name="onApplicationEnd" output="false">
         <cfargument name="applicationScope" required="true">  </cffunction>
     <cffunction name="onSessionEnd">
    </CFCOMPONENT>
    Then, in this root directory I also created a ProxyApplication:
     <!--- it's empty and it Serves merely to create an alias for your root /Application.cfc --->
     <cfcomponent name="ApplicationProxy" extends="AdvancementServices.Application"> 
    </cfcomponent>
    Then in the Sub-Directory, I can create a sub-folder level Application.cfc extending the root Application.cfc:
     <CFCOMPONENT displayname="Application" extends="ApplicationProxy">
        <!--- Set up the sub-folder application --->
        <cfset THIS.Name = "StudentServices_stdLoad"/> 
        <cfset THIS.ApplicationTimeout = CreateTimeSpan(0,0,30,0) /> 
        <cfset THIS.SessionManagement = true/> 
        <cfset THIS.SetClientCookies = false/> 
        <cffunction name="OnApplicationStart" access="public" returntype="boolean" output="false">
           <!--- ****** Testing whether the ADVUPGRD is accessible by selecting some data.****** --->
           <cftry>
           <cfquery name="TestMain_DSN" datasource="#application.MainDSN#" maxrows="2">
             SELECT Count(*)          FROM MyTable
           </cfquery>
             <!--- If we get a database error, report an error to the user, log the error information, and do not start the application. --->
            <cfcatch type="database">
              <cflog file="#this.name#" type="error" text="Main DSN is not available. message: #cfcatch.message# Detail: #cfcatch.detail# Native Error: #cfcatch.NativeErrorCode#" >
             <cfthrow message="This application encountered an error when connecting to the Main Database. Please contact support." />
             <cfreturn false>
           </cfcatch>
         </cftry>
         <cflog file="#this.name#" type="Information" text="Application #this.name# Started">
         <cfreturn true/>
       </cffunction>
    </CFCOMPONENT>
        <cfargument name = "SessionScope" required=true/>     <cfargument name = "AppScope" required=true/>
    </cffunction>
    <cffunction name="OnSessionStart" access="public" returntype="void" output="false"> 
      <CFSET session.UserGroup = ""/> 
      <CFSET session.UserName = ""/> 
      <CFSET session.currentPage = ""/> 
      <CFSET session.loggedin = "No"/> 
      <CFSET session.userrights = ""/>
      <cfreturn/>
    </cffunction>

    OK.  It sounds to me like you really shouldn't be using a single root Application.cfc at all, if all you want to do is share some settings between your "sub-applications".  I would look at storing the common settings in an external file that all of the applications can read in.  The simplest way is to put the settings in a .CFM file somwhere outside of the web root (so it is not directly web accessible) and load it with <cfinclude> tag into the OnApplicationStart() method of each sub-application's App.cfc.  That .CFM file can be as simple as:
    <cfset application.myCustomSetting = "blahblah">
    <cfset application.myOtherSetting = "foo">
    Alternatively, you can look at using a config file like this Ray Camden blog post suggests, and use the GetProfileSection(), GetProfileString(), and SetProfileString() functions as needed within OnApplicationStart().  You could even put ALL of your settings in
    A third option is to store your settings in an XML file or in JSON format in a text file.  You could then write code to read in the XML file, and use something like xml2struct.cfc to convert the XML into a struct, then append the struct to your application scope.  If you go the JSON route, then just read in the JSON file and use DeserializeJSON() to convert it into a struct, and append it to the application scope.
    What I think is probably the best approach is to use a community-supported MVC framework like FW/1 or ColdBox (maybe you already are, I don't think you've said so though).  One of the many advantages to doing so is that they have built-in "environment" support that can be used to configure common settings, depending on your environment (dev/qa/production).  You would handle reading in your external settings through the "environment" mechanism.
    One other thing to think about: your login mechanism.  I think you want to use one set of login tools that is shared by all of the "sub-applications".  You can do this also by putting the login/authentication-related code somewhere outside the webroot of your applications, and then either set up a mapping to that location in CF Admin, or set an application-specific mapping in your various App.cfc files.  That way all the "sub-applications" share a common set of code for the login process.  I don't know how your login process works (do all users go to the same login page then get redirected into their relevant "sub-application", or does each "sub-application" have a discrete login page that utilizes common back-end processes to authenticate and redirect), so you'll have to judge how that is best accomplished.
    Hopefully this gives you some useful ideas.
    -Carl V.

  • Webservices with xml file

    Hi,
    How can I read xml file using web services?
    Here is my cfc web services: (I just want to see how to read the xml file)
    <cfcomponent>
      <cffunction name="getBooks" access="remote" returntype="string" output="no">
        <cfargument name="xmlObject" type="xml" required="yes" >
        <cfset BookResponse = "">
        <cfset var arrIndx = "">
        <cftry>
            <cfloop from="1" to="#ArrayLen(arguments.xmlObject.XmlChildren)#" index="arrIndx">
                <cfset BookResponse= arguments.xmlObject.XmlChildren[arrIndx].XmlName>
            </cfloop>
          <cfcatch type="any">
              <cfset BookResponse= "#cfcatch.message# #cfcatch.detail#">
         </cfcatch>
       </cftry>
    <cfreturn BookResponse>
      </cffunction>
    </cfcomponent>
    Here my code to test the web services:
    1. Define the xml
    <!--- Setup some XML to work with --->
    <cfsavecontent variable="XMLFile"><?xml version="1.0"?>
    <root>
    <header>
    <user>1</user>
    </header>
    <book>
    <isbn>0321330110</isbn>
    <title>Macromedia ColdFusion MX 7 Certified Developer Study Guide</title>
    <author>Ben Forta</author>
    </book>
    <header>
    <user>2</user>
    </header>
    <book>
    <isbn>0596004206</isbn>
    <title>Learning XML, Second Edition</title>
    <author>Erik Ray</author>
    </book>
    <header>
    <user>3</user>
    </header>
    <book>
    <isbn>0782140297</isbn>
    <title>Coldfusion MX Developer's Handbook</title>
    <author>Raymond Camden</author>
    </book>
    </root>
    </cfsavecontent>
    2.Invoke the web services
    <cfinvoke
       method="getBooks"
       returnvariable="rawXMLBookList"
       webservice="http://localhost/Hoteleria/webServices/books.cfc?wsdl">
       <cfinvokeargument name="xmlObject" value="#XMLFile#">
    </cfinvoke>
    <!---<cfset XMLDocResult = XmlParse(rawXMLBookList)>
    <cfdump var="#XMLDocResult#">--->
    <cfdump var="#rawXMLBookList#' >
    3. Error: Element XMLOBJECT.XMLCHILDREN is undefined in ARGUMENTS.
    I try also using XMLParse without luck.
    Any ideas?
    Thanks

    Sorry about that. It did work for me!
    What about doing it on the basis of strings, as follows:
    books.cfc
    <cfcomponent>
      <cffunction name="getAuthors" access="remote" returntype="string" output="yes">
        <cfargument name="xmlString" type="string" required="yes" >
       <cfset var xmlObject = "">
       <cfset var rootChildren = "">
       <cfset var authors = "">
       <cfset var arrIndx = "">
        <cfxml variable="xmlObject"><cfoutput>#arguments.xmlString#</cfoutput></cfxml>
        <cfset rootChildren = xmlObject.xmlRoot.xmlChildren>
        <cftry>
            <cfloop from="1" to="#ArrayLen(rootChildren)#" index="arrIndx">
                <!--- 'Author' elements are in 'book'. The 'book' elements are even-numbered --->
                <cfif arrIndx mod 2 is 0>
                    <cfset authors = authors & chr(10) & chr(13) & rootChildren[arrIndx].author.XmlText>
                  </cfif>
           </cfloop>
          <cfcatch type="any">
              <cfset authors = "#cfcatch.message# #cfcatch.detail#">
         </cfcatch>
       </cftry>
      <cfreturn authors>
      </cffunction>
    </cfcomponent>
    testPage.cfm
    <!--- Setup XML string to work with --->
    <cfsavecontent variable="XMLFile"><root>
    <header>
    <user>1</user>
    </header>
    <book>
    <isbn>0321330110</isbn>
    <title>Macromedia ColdFusion MX 7 Certified Developer Study Guide</title>
    <author>Ben Forta</author>
    </book>
    <header>
    <user>2</user>
    </header>
    <book>
    <isbn>0596004206</isbn>
    <title>Learning XML, Second Edition</title>
    <author>Erik Ray</author>
    </book>
    <header>
    <user>3</user>
    </header>
    <book>
    <isbn>0782140297</isbn>
    <title>Coldfusion MX Developer's Handbook</title>
    <author>Raymond Camden</author>
    </book>
    </root>
    </cfsavecontent>
    <!---Invoke the web services--->
    <cfinvoke
       method="getAuthors"
       returnvariable="authorList"
       webservice="http://localhost/Hoteleria/webServices/books.cfc?wsdl">
       <cfinvokeargument name="xmlString" value="#XMLFile#">
    </cfinvoke>
    <cfdump var="#authorList#" >

  • Error handling with CFFEED?

    Hello, does anyone have a suggestion on handling errors from
    CFFEED reads?
    I'm reading an ATOM RSS feed from another site, but if there
    is ever an issue with that remote site, it would prevent my page
    from loading.
    If, for example, the RSS feed wasn't available, I would get
    an "Unable to read the source URL" error page.
    What I would like to have happen would be the page to
    continue processing, and instead of displaying the <CFOUTPUT
    query = "myQuery">, instead display something like "There was a
    problem with the newsfeed".
    Is there any way to ignore a "fatal error" from a CF tag, and
    just move on with processing the rest of the page?
    The code I've used here is Adobe's example for the CFFEED
    tag. The RSS URL I'm testing with is:
    http://feeds.emsresponder.com/emsresponderrss/top_ems_news
    Thanks in advance!
    -Ian in Los Angeles

    Use CFTRY and CFCATCH as suggested above. These tags can be
    used around pretty much any potentially problematic code.
    A good idea might be to put a CFMAIL tag in the CFCATCH which
    will notify you if something is wrong - although, this depends on
    how many people you'll have viewing the page, because you could end
    up getting a lot of emails - I'm sure there must be a better
    solution somewhere though, just an idea really.

  • MM_XSLTransform.cfc error: cfcatch.Proc

    I've been using the MM_XSLTransform.cfc for a couple years to
    do XSL transformation on a site, and it's worked quite well. Only
    just last night, I started receiving an error regarding
    cfctach.Proc:
    Element PROC is undefined in CFCATCH. <br>The error
    occurred on line 135.
    As well as:
    Element PROC is undefined in CFCATCH. <br>The error
    occurred on line 133.
    The version of the CFC that I'm using is 0.6.2, which I
    believe is the version that comes with Dreamweaver 8. Not sure if
    there's a new version for Dreamweaver CS3 or Dreamweaver CS4, for
    that matter.
    In any case, the lines in question are as follows:
    <cftry>
    <cfset XMLParse(myFile)>
    <cfcatch type="any">
    <cfif type EQ "xml">
    <cfset setError(getErrorFromCode('MM_INVALID_XML_ERROR',
    errSrc) & cfcatch.Proc & ' ' & mySrc & '<br>'
    & cfcatch.Message & '<br>' &
    HTMLEditFormat(cfcatch.Detail) & '<br>' &
    HTMLCodeFormat(myFile))>
    <cfelse>
    <cfset setError(getErrorFromCode('MM_INVALID_XSL_ERROR',
    errSrc) & cfcatch.Proc & ' ' & mySrc & '<br>'
    & cfcatch.Message & '<br>' &
    HTMLEditFormat(cfcatch.Detail) & '<br>' &
    HTMLCodeFormat(myFile))>
    </cfif>
    </cfcatch>
    </cftry>
    This error could also potentially pop up in this section:
    <cftry>
    <cfset output = XmlTransform(Arguments['xml'],
    Arguments['xsl'])>
    <cfcatch type="any">
    <cfset
    setError(getErrorFromCode('MM_TRANSFORMATION_ERROR') &
    cfcatch.Proc & & '<br>' & cfcatch.Message)>
    </cfcatch>
    </cftry>
    In looking at the documentation for cfcatch, Proc (as in
    cfcatch.Proc) does not appear to be a valid attribute for cfcatch,
    and there isn't anywhere else within the cfc where Proc gets tacked
    on to the cfcatch.
    For now, to prevent the error from occurring, I've commented
    out all instances of cfcatch.Proc.
    Not sure why this popped up now. It may mean there's an error
    in one of my XML files, which I will need to investigate.
    If anyone has any insight to share on the perils of
    cfcatch.Proc, it would be appreciated.
    Thanks,
    Marc

    I am passing RequestTimeOut="120" in the url. The 120 seconds
    is the value that has been determined to be the maximum that we
    want the app to run before timing out. The issue I have is that the
    ColdFusion Blue Error page is not acceptable error handling and I
    have not been able to capture the timeout. That is my request, how
    to capture the timeout and follow acceptable error handling in this
    timeout situation.

  • Coldfusion Error catching (cftry cfcatch) best practice question...

    Hey all -
    I wanted to get a couple of opinions about this.  Obviously I want to catch any and all errors that hit my server and avoid exposures to my end users, but I didnt know what the most efficient way of doing such was.  Does it make sense to put a cftry cfcatch around the entirety of my code on every page?  (I use a lot of embeds...cfinclude)  Or is that too broad?  How does that effect performance?  Is there another way to auto catch and email all errors and then show the user a custom error page?  I searched around, but I got bits and pieces based on specific requests...not really any "best practice" tips.  Any suggestions would be fantastic.
    Thanks much!

    There are no real best practices as such, as it's largely down to your application. The only real "standard" is the onError() method in Application.cfc, which will handle any Exceptions which make their way to it - i.e. any that are not caught by an explicit try/catch block.
    When considering what you are now, I consider this: where do I want to display an error? How far down the line does it matter? There's no right or wrong answer, it's down to you.
    Say you're displaying a page, which is made up of ten includes. If there's an error in one, do you want the other nine displayed, or do you want the whole page to error? If it's the former, wrap each one in its own try/catch. If it's nonsensical to do so, just let the page throw an Exception to get picked up by your Application.onError() method.
    It also depends largely on whether or not an error is "recoverable" - is it of any use telling someone that a small but important part of the page failed becuase of a database issue? Probably not. There's nothing they can do about it, so just throw an error and let your error template sort it out.
    It also depends on the context in which the page is being called - if it's an Application with users, you can display an error page with as much or as little information as you want. If it's a remote CFC call, however, it's extremely annoying for the remote developer to just get useless ColdFusion exceptions. Therefore I would always wrap every remote CFC method in its own try/catch, so if something goes wrong you can still return them something useful - even a "false" is better sometimes than an exception. You can then do what you like within the catch block - send you an email, log to disk, whatever.
    Just a few thoughts, haven't proof read them though so expect massive, glaring mistakes and poor advice.

  • Issues with encrypt/decrypt

    I got a system that is behaving strange what appears to be randomly.
    I create a CURD cfc for this table and to store the password I use  
    Encrypt and when it's been red from the CFC it gets decrypt by the cfc.
    Here is the few lines of code from the CFC that is in charge of it.
    On update (same method is doen on crate as well):
    <cfif isdefined("arguments.fu_password")>fu_password=<CFQUERYPARAM value="#left(encrypt(trim(arguments.fu_password), this.encKey),250)#" cfsqltype="cf_sql_varchar" maxlength="250">,</cfif>
    On read (after I query the database):
    <cfloop query="qReadFrontend_Users">
                            <cfset qReadFrontend_Users.fu_password[currentrow] = #Decrypt(qReadFrontend_Users.fu_password[currentrow], this.encKey)#>
    </cfloop>
    It worked well (I use this method everywhere I need to save the data encrypted) for a long time, and IT STILL works well on my server. But about 2 months a go I started to get errors that the input/output of the encryption is not the same.
    The MUST strange thing is that the errors will be sent to me WITOUT the page being viewed been relocated to the error page (which is what happens when an error accurse on that system). And on top of that the CFC would RETURN the SQL with the RIGTH INFO !! IE it decrypts the info but yet say there was a problem.
    I then added this to the CFC …
    <cftry> <!--- THIS IS A TEST --->
                            <cfloop query="qReadFrontend_Users">
                            <cfset qReadFrontend_Users.fu_password[currentrow] = #Decrypt(qReadFrontend_Users.fu_password[currentrow], this.encKey)#>
            </cfloop>
                                        <cfcatch type="any">
                                                    <cfmail from="****" to="*****" subject="FRONT END USERS CFC CF CATCH EMAIL !!!!" type="html">
                                                                cfcatch:
                                                                <cfdump var="#cfcatch#">
                                                                <BR><BR>
                                                                arguments:
                                                                <cfdump var="#arguments#">  
                                                                <BR><BR>
                                                                Query
                                                                <cfdump var="#qReadFrontend_Users#">
                                                                <BR><BR>
                                                                this
                                                                <cfdump var="#this#">
                                                                <BR><BR>
                                                                cgi
                                                                <cfdump var="#cgi#">
                                                    </cfmail>
                                                    <cfreturn qReadFrontend_Users>                    
                                        </cfcatch>
                            </cftry>
    And I started getting emails. in all of the emails the RETRURNED query is fine, as I mentioned above.
    I also checked the DB, outputting each row and its decrypt password, the problems is not in the DATA IT SELF, the data is k-ok !.
    And again this happens totally on random, no pattern to it what so ever.
    My Q' is, did any one encountered something like this?
    My first guess was that the SQL is not ok in some why, but I have NO idea what to look for.
    Please HELP : )

    Sorry, I have solved this problem, Thank you.

Maybe you are looking for