FileDelete Question

Results 1 to 3 of 3

Thread: FileDelete Question

  1. #1
    Join Date
    Dec 1969

    Default FileDelete Question

    On my site I have a function that deletes files. The the virtual path to the file is stored in a Access DB field. The contents of this field are passed to the function, the path is then converted into a physical path via the ServerMapPath function and the file deleted..... or maybe not. Am at a complete loss. Instead I get an error message saying that the file cannot be found. As far as I am aware all file permissions are set up correctly... very confused. <BR>Am I making a mistake when passing the variable to DeleteFile?<BR>I&#039;ve included the function below if anyone feels like a crack.<BR><BR>Function delFile(file)<BR> dim fs, path<BR> set fs=CreateObject("Scripting.FileSystemObject")<BR> &#039;path = Server.MapPath(file)<BR> fs.DeleteFile "&#039; & path & &#039;", False<BR> set fs = Nothing<BR>End Function<BR><BR>Thanks,<BR><BR>Nell

  2. #2
    Join Date
    Dec 1969

    Default Death of a file

    I would check the path you are getting<BR><BR><BR><BR>has some good fso stuff for you <BR>on if fileexists <BR>and the deletion<BR><BR>i bet your file path is incorrect.

  3. #3
    Join Date
    Dec 1969

    Default RE: Death of a file

    Might be a typo, but you have a &#039; before the path variable which would render the entire line a remark.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts