Deleting a file with the FileSystemObject

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Deleting a file with the FileSystemObject

    Going round in circles trying to do this. If I use:
    Set objFS = Server.CreateObject
    ("Scripting.FileSystemObject")
    objFS.DeleteFile (vPath & "AndreaBremner.gif")
    the page hangs on the objFS.DeleteFile
    and if I use:
    Set objFS = Server.CreateObject
    ("Scripting.FileSystemObject")
    Set objFile = objFS.GetFile (server.mappath
    ("Temp\AndreaBremner.gif"))
    objFile.Delete
    it hangs on the Set objFS.

    What am I doing wrong?

    Thanking you in anticipation.



    Roger Withnell Guest

  2. Similar Questions and Discussions

    1. Deleting a file
      Is it possible to delete a single file from Adobe or acrobat?
    2. Deleting File Info
      It seems like your first response is correct, though I do not see any way in the Batch command to accomplish this. An example of what I want to...
    3. File size remains the same after deleting pages
      I am using AA 5.0 I am working with a 200 pages PDF file and need to delete, let's say 100 pages. After doing so, the file size remains the same....
    4. Error deleting file or folder
      After using the Search Companion, I get the following error message when I try to delete multiple files. Error Deleting File or Folder Cannot...
    5. Deleting images from file browser
      Harley, The file browser will not perform certain tasks on images located on the desktop. This is because on certain OSes the desktop is a virtual...
  3. #2

    Default Re: Deleting a file with the FileSystemObject

    Go to [url]www.aspfaq.com[/url] and enter a search phrase of: file system object hangs

    Ray at work

    "Roger Withnell" <roger@upperbridge.co.uk> wrote in message
    news:027b01c34a3f$3818a480$a401280a@phx.gbl...
    > Going round in circles trying to do this. If I use:
    > Set objFS = Server.CreateObject
    > ("Scripting.FileSystemObject")
    > objFS.DeleteFile (vPath & "AndreaBremner.gif")
    > the page hangs on the objFS.DeleteFile
    > and if I use:
    > Set objFS = Server.CreateObject
    > ("Scripting.FileSystemObject")
    > Set objFile = objFS.GetFile (server.mappath
    > ("Temp\AndreaBremner.gif"))
    > objFile.Delete
    > it hangs on the Set objFS.
    >
    > What am I doing wrong?
    >
    > Thanking you in anticipation.
    >
    >
    >

    Ray at Guest

  4. #3

    Default Re: Deleting a file with the FileSystemObject

    > What am I doing wrong?

    Running client anti-virus software on a server.
    [url]http://www.aspfaq.com/2180[/url]


    Aaron Bertrand - MVP Guest

  5. #4

    Default Re: Deleting a file with the FileSystemObject

    Right on Aaron. Wish I'd tried it on the operational server before
    panicking and posting my problem

    Let me ask another dumb question.

    In session 1, an image is pulled out of a database and saved to server
    hard disk and when the page has finished with it it deletes the copy on
    the hard disk.

    Meanwhile, session 2 is using the same image ie the same path and
    filename and hasn't finished with the image when session 1 deletes it.

    Does IIS, ASP or somebody else take care of this eventuality or do I
    have a problem?




    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Roger Withnell Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139