Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting file using <cffile> not working

Status
Not open for further replies.

bamboo

Programmer
Aug 22, 2001
89
US
I have a form that allows a user to upload a file to a folder on the host webshare. This works fine. I can also use <cfdirectory> to view the files from that folder. However, when trying to delete I get the error that the destination is invalid. I worked with our admin who setup the CF service account permissions for me to delete from that directory, however it's not working. I'm not an admin by no means, but if anyone has suggestions that would be great.
 
Hi Falconseye. Thanks for the feedback. What do you mean by "get"? I have read/write access to the share on the Web server and can cut/copy/paste/delete manually. As far as <cffile> I have only used action="upload" which works.
 
Do you get any error messages when you attempt to delete the file? What does your code look like? Wrap <cftry><cfcatch> around the <cffile action="delete"> and do a <cfudmp> of the error (if any).

Code:
<cftry>
  ...
  <cffile action="delete"> 
  ...
<cfcatch type="all">
  <cfdump var="#cfcatch#" label="cffile delete erors">
</cfcatch>
</cftry>

What FALCONSEYE is suggesting is can you retreive the file that you are attempting to delete? Do a series of tests, like <cffile action="copy"> or <cffile action="read"> to see if that works.

____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top