ASP DeleteFile Method

ASP DeleteFile Method

The DeleteFile method deletes one or more specified files.

Syntax
FileSystemObject.DeleteFile(filename[,force])

Parameter Description
filename - Required. The name of the file or files to delete (Wildcards are allowed)
force - Optional. A Boolean value that indicates whether read-only files will be deleted. True indicates that the read-only files will be deleted, False indicates that they will not be deleted. Default is False

Example
<%
dim fso
Set fso=Server.CreateObject(”Scripting.FileSystemObject”)
fso.CreateTextFile(”c:\file1.txt”,True)
if fso.FileExists(”c:\file1.txt”) then
  fso.DeleteFile(”c:\file1.txt”)
end if
set fso=nothing
%>

 

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.