• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cffile

Guest
Jun 29, 2009 Jun 29, 2009

Copy link to clipboard

Copied

I am using a cffile to delete a file from a directory on my server. On occasion I get an error stating that the file doesn't exist when in fact it does. I am using an absolute directory path: here is an example for my code.

    <cfif isDefined("Form.filename")>
    <cffile action="delete" file="C:\root\images\#Form.filename#">
    </cfif>

Prior to this running, I am uploading a file with a different name in the same directory.

Views

447

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 29, 2009 Jun 29, 2009

Copy link to clipboard

Copied

I had something to the same issue you are having, and after pulling almost all my hair out over several weeks, I cam across this.

#71110 page 16 in http://www.adobe.com/support/documentation/en/coldfusion/801/cf801releasenotes.pdf

'Under heavy load, the cffile tag might attempt to create two temporary files with the same

name, resulting in problems such as missing file errors when trying to access a file.'

Althought I had different names, there is a hot fix out there that helped me.

The fix that helped me was:

http://blog.tygate.com/?p=403

I was working with flex and coldfusion 8 but this might help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 29, 2009 Jun 29, 2009

Copy link to clipboard

Copied

LATEST

Hi,

Please check the file exists in the directory before trying to delete.

<cfif FileExists(ExpandPath(yourfile))>

......

</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation