Results 1 to 2 of 2

Thread: DeleteFile

  1. #1
    Join Date
    Dec 1969

    Default DeleteFile

    Hello everybody!<BR><BR>I have a very tricky problem. My page should delete a file with the code below and it does it, BUT it always writes out an errormessage that the file was not found (But has already deleted ???). <BR>CODE:<BR><BR>&#060;%@ LANGUAGE = VBScript %&#062;<BR>&#060;% Option Explicit %&#062;<BR><BR>&#060;%<BR>Response.Buffer = True<BR><BR>DIM myFilePath<BR>DIM myObjFS<BR><BR>...<BR><BR>Set myObjFS = CreateObject("Scripting.FileSystemObject")<BR><BR> myFilePath = Server.Mappath("/images/picturename.jpg")<BR><BR>IF myObjFS.FileExists(myFilePath) THEN<BR> myObjFS.DeleteFile(myFilePath)<BR>END IF<BR><BR>response.end<BR>%&#062;<BR><BR>If anyone has an idea please tell me.<BR><BR>Nice greetings,<BR><BR>Markus

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default Which line generates that message

    &#062;myObjFS.DeleteFile(myFilePath)<BR>how about putting a message instead of this and see if it works<BR><BR><BR>i dont see why you get that error unless some other piece of code generates it.<BR><BR>

Posting Permissions

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