Forums

ASP

This topic is locked

delete file

Posted 21 Nov 2006 22:23:40
1
has voted
21 Nov 2006 22:23:40 Tom Purdum posted:
I have a page that lists the contents of a directory. It puts this all into a table to be displayed for the user. What I am trying to do is let the user click a "delete" link and have that file deleted. What would be really nice is to have a confirm box popup as well. I know that I need to use the filesystemobject, but I am not sure how. Here is my code that reads the directory and puts it into a table

FileList = "C:\sites\snfcb\reports\" & ProvNum
Set fso=Server.CreateObject("Scripting.FileSystemObject"
Set f=fso.GetFolder(FileList)
Set fc = f.files
For Each f1 in fc


%>
<tr>
<td><a href="/reports/<%=ProvNum%>/<%=f1.name%>" class="style9"><%=f1.name%></a></td>
<td><span class="style9"><%=f1.datelastmodified%></span></td>
<td><span class="style9">Delete</span></td>
</tr>


I did note write this code, I am just trying to modify it without rewriting the page.

Reply to this topic