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 7965907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:16:43+00:00 2026-06-04T06:16:43+00:00

I seem to be having an issue with the photo uploading function on a

  • 0

I seem to be having an issue with the photo uploading function on a site I’m working on.

<cftry>

                <cffile
                    action="upload"
                    destination="#physicalPath#\PHOTOS"
                    filefield="photo"
                    nameconflict="makeunique"                       
                    accept="image/jpeg, image/pjpeg" 
                    result="mypicture"
                />                                                    


     <cfset OutcomeID = "#FORM.OutcomeID#"/> 
              <!---Inserts file name and outcome id into Uploads table in the database --->
  <cfinvoke component="#classpath#.cf_classes.dao.uploads" method="insertPhoto" returnvariable="success">
    <cfinvokeargument name="fileName" value="#mypicture.SERVERFILE#"/>
    <cfinvokeargument name="OutcomeID" value="#OutcomeID#"/>
    </cfinvoke>

      <cfset photoError = "Photo uploaded successfully"/>
<cfcatch type="any">
      <cfset photoError = "There was an error uploading your photo.<br/> Please make sure it is a JPEG format."/>
   </cfcatch>
</cftry>

No matter what, I just keep getting back the error message defined in the cfCatch. What are some good ways to troubleshoot something like this? Do any problems stand out to anyone?

Thanks for the help, I’m still relatively new to CF.

  • 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-06-04T06:16:45+00:00Added an answer on June 4, 2026 at 6:16 am

    You’re masking the exception that your cfcatch is catching by just setting a string in there. If you don’t want to remove your exception handler, a quick and easy way to see what the underlying error is while you’re still working on the code is to add:

    <cfcatch><cfdump var="#cfcatch#"></cfcatch>
    

    You may want to add an abort="true" to your cfcatch to stop processing of further code at that point which can mask your exception dump or cause it not to appear.

    Putting cfcatch.message into a string that the user sees is not good practice as this may potentially result in information disclosure which can be a security risk (eg. if the message contains a file path on your server or similar)

    Long term, if you’re using Coldfusion Builder then you can also use the Coldfusion Debugger that is built in to step through your code and see where it is failing at the state of your variables at that point.

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

Sidebar

Related Questions

I seem to be having a strange issue with a 2D game I'm working
I am having an issue with my function. I can't seem to figure out
I am having an issue with a simple form uploading script. On this upload
I am having an issue that I can't seem to figure out. Hopefully somebody
I am having a strange issue that I can't seem to resolve. Here is
I always seem to be having fun working with the Ax 2009 product until
I seem to be having an issue with PHP rounding (sort of) numbers by
I seem to be having an issue with Jax-WS and Jax-b playing nicely together.
I seem to be having an issue with Xalan's translate method. I have the
I've been working on an asp.net 4.0 website and seem to be having an

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.