Class: SoftArtisans.SAFile
Method: Delete ([in,optional] Filename)
Description: This method deletes a file from the web server's hard disk.
If a filename is specified, it must contain the entire valid path.
If no file is specified, the current uploaded file will be deleted. This allows you to effectively cancel an upload.
Example 1:
<%
upl.Form("FILE1").SaveAs filename
if Err = 0 Then
Response.Write("Upload saved successfully to " & upl.Form("FILE1").ServerName & "<BR>")
'---
'--- Perform some other processing here, such as writing to a database
'---
'--- Assume some error occurred - delete the uploaded file
'---
upl.Form("FILE1").Delete
If Err <> 0 Then
Response.Write("An error occurred when attempting to delete the uploaded file.<BR>")
Else
Response.Write("Uploaded file has been deleted.<BR>")
End If
Else
... %>
Example 2:
<%
set objFile = Server.CreateObject("SoftArtisans.SAFile")
objFile.Delete Request.Form("FILE1")
%>