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

  • Home
  • SEARCH
  • 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 9240889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:15:58+00:00 2026-06-18T08:15:58+00:00

We have a system that lets a user upload a file, we loop through

  • 0

We have a system that lets a user upload a file, we loop through that file and then make another file. The user that uploads the file is a logged in user.

Problem is that the files contain sensitive data so we have to delete them. As you can imagine there are a few places that write more info to the file and read the file. Sometimes an error happens on this page (normally something to do with CFFILE).

So my question is, is it fine to place all the code (most of it anyway) in a giant CFTRY? Then catch any exception that happens, then run another CFTRY inside the CFCATCH to delete the 2 files?(Read the update) I’m not too worried about performance as this process is not done a million times a day, maybe 3 times a month.

Is this acceptable practice for making sure files are deleted?

UPDATE I wont be deleting the files in the CFCATCH. I’ll first check if the exist. Then delete them.

  • 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-18T08:15:59+00:00Added an answer on June 18, 2026 at 8:15 am

    I had to write a new section of code that almost did the same thing as what I asked. Instead of writing individual lines to the file and then wrapping a big CFTRY around that. I instead wrote each line to a variable and ended each line with a new line character, in my case (Windows) the new line characters where Chr(13) & Chr(10). But you should rather use the following line of code

    <cfset NL = CreateObject("java", "java.lang.System").getProperty("line.separator")>
    

    Which will make the variable NL equal to the current system new line character.

    Then you can have a small CFTRY where you can write the entire variable to a file.

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

Sidebar

Related Questions

I have an action that lets the customer preview system email messages and i
Lets say that I have two strings: The System is in halt state. The
I have big system that make my system crash hard. When I boot up,
I have started building a notifications system.. And when a user posts on another
I have a web site which handles files management. User can upload file, add
I have a web application that lets users upload entire .html files to my
I have a small email application that lets a user build a message from
I am designing a system that lets a user assign a specific task to
I have python code below that will loop through a table and print out
I have this follow system that lets you follow certain type of statuses. When

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.