Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Header Error

  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Internet Explorer Header Error

    If someone can tell me where I went wrong I'd appreciate it!

    My error:
    Response object error 'ASP 0156 : 80004005'

    Header Error

    /douploadpic.asp, line 19

    The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.


    And my code:
    <html>
    <head>
    <title>Uploding...</title>




    </head>

    <%
    Set Upload=Server.CreateObject("Persits.Upload.1")
    Count = Upload.SaveVirtual ("/uploads")

    for each file in Upload.Files
    thePath=thePath & file.Path
    next

    redirectPath="m.1apshost.com/thegroupgenesis/editprofile.asp?newpic=" & thePath

    response.redirect(redirectPath)
    %>


    <body>



    </body>
    </html>

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    you are redirecting after writing some page-content to the browser. Try doing your asp stuff first in your page, or try Response.Buffer=True in your page:
    top of page:
    <% Response.Buffer = True %>
    I am the luckiest man in the world

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Unhappy

    Thanks for your help thus far, but....

    Okay, when the asp stuff is first on the page, the browser spits this error:
    HTTP Error 404
    404 Not Found

    The Web server cannot find the file or script you asked for. Please check the URL to ensure that the path is correct.

    Please contact the server's administrator if this problem persists.

    And the corresponding code:
    <%Response.Buffer=True
    Set Upload=Server.CreateObject("Persits.Upload.1")
    Count = Upload.SaveVirtual ("/uploads")

    for each file in Upload.Files
    thePath=thePath & file.Path
    next

    redirectPath="m.1apshost.com/thegroupgenesis/editprofile.asp?newpic=" & thePath

    response.redirect(redirectPath)
    %>
    <html>
    <head>


    <title>Uploding...</title>

    </head>

    <body>

    </body>
    </html>



    And If I try putting it after HTML:
    I get back the error I had previously

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    try to response.write the redirectpath to see if that delivers a valid url
    I am the luckiest man in the world

  • #5
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    it spits this:
    m.1apshost.com/thegroupgenesis/editprofile.asp?newpic=I:\scroft\thegroupgenesis\uploads\me bored.jpg

    is there a way i could just get the filename, not the file path?


  •  

    Posting Permissions

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