delete file - Server.MapPath problem

Discussion in 'ASP General' started by Jake, Feb 21, 2005.

  1. Jake

    Jake Guest

    What's wrong with this code? Thie file is there, why cant it find it?

    Thanks in advance!

    <%
    myfile = request.querystring("filename")
    response write myfile
    myFSO.DeleteFile(Server.MapPath(" & myfile & "))
    SET myFSO = NOTHING
    %>

    OUTPUT:
    data/000000/index.htm

    Microsoft VBScript runtime error '800a0035'

    File not found

    /deletefile.asp, line 9
    Jake, Feb 21, 2005
    #1
    1. Advertising

  2. Jake

    Jake Guest

    Nevermind!
    Got it.
    myFSO.DeleteFile(Server.MapPath(myfile))


    "Jake" <> wrote in message
    news:%...
    > What's wrong with this code? Thie file is there, why cant it find it?
    >
    > Thanks in advance!
    >
    > <%
    > myfile = request.querystring("filename")
    > response write myfile
    > myFSO.DeleteFile(Server.MapPath(" & myfile & "))
    > SET myFSO = NOTHING
    > %>
    >
    > OUTPUT:
    > data/000000/index.htm
    >
    > Microsoft VBScript runtime error '800a0035'
    >
    > File not found
    >
    > /deletefile.asp, line 9
    >
    >
    >
    Jake, Feb 21, 2005
    #2
    1. Advertising

  3. Jake wrote:
    > What's wrong with this code? Thie file is there, why cant it find it?
    >
    > Thanks in advance!
    >
    > <%
    > myfile = request.querystring("filename")
    > response write myfile
    > myFSO.DeleteFile(Server.MapPath(" & myfile & "))
    > SET myFSO = NOTHING
    > %>
    >
    > OUTPUT:
    > data/000000/index.htm
    >
    > Microsoft VBScript runtime error '800a0035'
    >
    > File not found
    >
    > /deletefile.asp, line 9

    As a guess, I would say permissions. I suspect your IUSR account lacks
    permissions to brows the folder
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Feb 21, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon
    Replies:
    5
    Views:
    11,134
    Scott M.
    Jan 17, 2010
  2. Peter Row
    Replies:
    0
    Views:
    461
    Peter Row
    Mar 1, 2004
  3. =?Utf-8?B?dHBhcmtzNjk=?=

    server.mappath vs. request.mappath

    =?Utf-8?B?dHBhcmtzNjk=?=, Mar 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,134
    Juan T. Llibre
    Mar 11, 2007
  4. Replies:
    4
    Views:
    957
    Juan T. Llibre
    Oct 7, 2007
  5. AAaron123
    Replies:
    11
    Views:
    1,194
    AAaron123
    Sep 9, 2009
Loading...

Share This Page