Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5982525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:05:59+00:00 2026-05-22T22:05:59+00:00

I found this question asked previously but it contained bad examples and no true

  • 0

I found this question asked previously but it contained bad examples and no true answers so I am here to ask it again. First the code:

The HTML:

<td><input type="button" name="clear_#get_images.prdt_img_rel_ID#_cache" value="Clear Cache" onClick="clearCache('#get_images.images_name#');"/></td>

The Proxy:

<cfajaxproxy cfc="/cfc/cloudfiles" jsclassname="proxy">

The Javascript:

<script type="text/javascript">
    var proxy = new proxy();
    function clearCache( objectName ) {
        proxy.setCallbackHandler( purgeResultsHandler );
        proxy.setErrorHandler( myErrorHandler );
        alert(objectName);
        proxy.purgeItemDirectly( objectName );
    }

    var purgeResultsHandler = function ( res ) {
        alert( res );
    }

    var myErrorHandler = function(statusCode, statusMsg) {
        alert('Status: ' + statusCode + ', ' + statusMsg);
    }
    </script>

The CFC:

<cffunction name="purgeItemDirectly" access="remote" returntype="string" output="false">
    <cfargument name="container" type="string" required="false" default="content" />
    <cfargument name="objectName" required="true">
    <cfset var res = '' />

    <cfhttp method="DELETE" charset="utf-8" url="#variables.cdn_url#/#_encodeContainerName(arguments.container)#/#_encodeObjectName(arguments.objectName)#">
        <cfhttpparam type="header" name="X-Auth-Token" value="#variables.auth_token#" />
        <cfhttpparam type="header" name="X-Purge-Email" value="#Application.debuggingEmail#" />
    </cfhttp>

    <cfswitch expression="#ListFirst(cfhttp.statusCode, " ")#">
        ... code to iterate through responses ...           
    </cfswitch>
    <cfreturn res >
</cffunction>

As you can see, I have an alert to check the objectName in the JS. At this point the objectName does exist. However, it does not exist as soon as I get into the cffunction in the cfc. I have inserted text values to return into the cfc so I know it is getting called correctly, I simply cannot pass a value into it (either from a variable or just a plain string).

Thanks in advance for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:06:00+00:00Added an answer on May 22, 2026 at 10:06 pm

    In your javascript, you’re calling the function with a single argument (proxy.purgeItemDirectly( objectName )). Your CFC defines two arguments: container and objectName. So your javascript is passing your objectname argument into the container argument of the CFC. You need to make sure that you pass in both arguments, or you change the order of the arguments in your CFC to match what you expect from your JavaScript calls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, i've read most relevant questions asked here previously on this but I still
I've asked this question over on the MSDN forums also and haven't found a
I searched and found this question but did not like the answer. Is there
I haven't found an answer to this particular question; perhaps there isn't one. But
I searched for this and found Maudite's question about text editors but they were
I've seen this question asked around before, and found an answer for how to
I guess this question was asked in one way or another, but I'm looking
I notice this question has been asked a few times but I don't really
Reading this question I found this as (note the quotation marks) code to solve
I found this question in an old question in your website so i thought

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.