my db contains the locations of a load of files used in my project (all files are *.dat)
however i need to set it so that the user can delete the file from browser
my current script will delete the db record of the file, but i need to delete the file aswell
the files were all created on the server using the FS object.
i know the fileSystem object has a delete file function but i cant get it to actually delete the file. it reports that the file cannot be found.
what ive tried is:
(ive only included the working code for the function)
i think the error lies in the line:
any help will be much appreciated
I can't be bothered to have a sig!
however i need to set it so that the user can delete the file from browser
my current script will delete the db record of the file, but i need to delete the file aswell
the files were all created on the server using the FS object.
i know the fileSystem object has a delete file function but i cant get it to actually delete the file. it reports that the file cannot be found.
what ive tried is:
(ive only included the working code for the function)
Code:
fileid = request.form("file")
set RS=Server.CreateObject("ADODB.recordset")
RS.Open "SELECT * FROM tblFiles WHERE fileid=" & fileid & "", conn, 2,2
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile(RS.fields("fileLocation"))
f.Delete
RS.delete
RS.Close
i think the error lies in the line:
Code:
set f=fs.GetFile(RS.fields("fileLocation"))
any help will be much appreciated
I can't be bothered to have a sig!