Skip to main content
December 2, 2008
Question

CFFILE Delete option

  • December 2, 2008
  • 2 replies
  • 1286 views
I have CF 8 enterprise edition running on a Windows 2003 server. I developed an application for the users to upload files. I am using CFFILE to create sub folders, create files, rename files, and read files - no problem. But when I try to delete files, I get the error 'ColdFusion could not delete the file E:\QualityDataFiles\SCOTT2\DELETEME.TXT for an unknown reason.'; I am using <cfdump var="#cfcatch#"> to get this much of an error message; nothing gets recorded to the CF logs.
From the server console, I looked at the properties for the sub folder SCOTT2 and saw the Read-Only attribute has a grey check-mark. That means that Read-Only is not 'On' or 'Off', but 'partly On'.
Microsoft says they did this on purpose. The grey check-mark means that some file under the folder has the Read-Only attribute On. Oh, and good luck finding the specific file. An MS knowledge article says you should use the attrib DOS command to blanket change all the files, but that didn't change anything.
If I intentionally set the Read-Only attribute on the DELETEME file, the error message tells me that the file is Read-Only. But when I remove the Read-Only attribute, the CFFILE DELETE just goes back to the 'unknown error' message.
Does anyone know a way around this Microsoft enhancement?
Scott
    This topic has been closed for replies.

    2 replies

    December 2, 2008
    Okay, I found the IIS permissions - which is really just the OS permissions. I made sure that the USERS group had Modify permission. But I still get the same error.
    Inspiring
    December 2, 2008
    Is E: a harddrive on the server running CF8 or a mapped drive?
    December 2, 2008
    Mr. Dobbs,
    Yes, drive E is on the server running the CF8. When I call CFFILE DELETE, I am using an absolute path.

    Scott
    tclaremont
    Inspiring
    December 2, 2008
    I presume you kniow the account name that ColdFusion is running under. In IIS, make sure that this same account has full rights for the directory in question.
    December 2, 2008
    Tclaremont,
    Do you really mean IIS. I thought that when the CFFILE DELETE command was run that it was passed to the CF8 application service which is running as the Local System user. This 'user' then interacts with the Windows OS just lile a regular user at the console.
    Where would you go in IIS to set the permissions?

    Scott