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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:52:29+00:00 2026-06-10T05:52:29+00:00

I’m pulling my hair our here and really can’t figure out why this code

  • 0

I’m pulling my hair our here and really can’t figure out why this code will not work. I need to use <cffile action="write"> to put a document on the server.

I’ve stripped the code to its bare minimum in an attempt to get the file to write to the server, however it still won’t budge. The code I am running is this.

<cffile action = "write" 
        file = "test.txt"
        output = "Content"
>

When I run this code on the server, it does nothing. I get no error messages on-screen, however no file appears on the server either.

I’ve been searching for a while and the only thing I could seem to come up with was writing the absolute file path, so I’ve also tried this too

<cffile action = "write" 
        file = "http://www.my_url.com/test.txt"
        output = "Content"
>

Which does get me an error message (see below), however searches for how to sort this error message have been less than useful.

An error occurred when performing a file operation write on file 
http://www.my_url.com/test.txt.
The cause of this exception was: java.io.FileNotFoundException:  
http://www.my_url.com/test.txt.

I thought this could be a problem with my privileges, however there is no ‘access is denied‘ error on the end of the FileNotFound, so I really am lost as to what to do.

It’s doubly infuriating because on this exact site I am also using <cffile action="upload"> which works absolutely fine!

  • 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-10T05:52:31+00:00Added an answer on June 10, 2026 at 5:52 am

    As mentioned above, cffile only operates on the server file system. So you need to use a physical file path, not a url. Also, the documentation says if you use a relative path the file is written to:

    “…(a path) relative to the ColdFusion temporary directory, which
    is returned by the GetTempDirectory function.”

    So if you did not receive an error, the file was created, just not where you expected. To avoid this kind of confusion, use absolute paths:

        <cffile action="write" file="c:/path/to/test.txt" output="Content">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need a function that will clean a strings' special characters. I do NOT
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

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.