Current location: Hot Scripts Forums » Programming Languages » ASP » Header Error


Header Error

Reply
  #1 (permalink)  
Old 06-19-03, 05:05 AM
bonnie bonnie is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Header Error

Response object error 'ASP 0156 : 80004005'

Header Error

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

What can I do??

Reply With Quote
  #2 (permalink)  
Old 06-19-03, 05:18 AM
Tesco Tesco is offline
ASP Guru
 
Join Date: Jun 2003
Location: UK
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
From, that, I think your trying to send some kind of file (excel, pdf) through HTTP? Thus, you doing http:// at the beginning of the link, and adding a HTTP header, which is the wrong thing to do.

I think, there are some other headers you could try but, I don't them - try searching google - or maybe someone here can tell us about the other headers available.
Reply With Quote
  #3 (permalink)  
Old 06-19-03, 09:27 AM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
Also, are you trying to modify cookies after output from the page has already been sent?
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Reply With Quote
  #4 (permalink)  
Old 06-19-03, 10:32 AM
Stealth Stealth is offline
1337 pr0gr4mm3r
 
Join Date: Jun 2003
Location: Glasgow, Scotland
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
The best thing to do is test your page after everything you add so you can pinpoint any errors
Reply With Quote
  #5 (permalink)  
Old 06-20-03, 02:16 AM
bonnie bonnie is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy

I think the problem is the page can not redirect the file(excel,pdf). Say for example, it can check the record exists or not. if the record exist. then open the related file.

<%
While Not rs.EOF
For i=0 to rs.Fields.Count-1
Response.Redirect rs.Fields(3)
Next
rs.MoveNext
Wend
Response.Write "<CENTER>"
Response.Write "Record not found !!"
Response.Write "</CENTER>"
%>

the error is in the red line. The file type is OLE Object.
Reply With Quote
  #6 (permalink)  
Old 06-20-03, 12:07 PM
Stealth Stealth is offline
1337 pr0gr4mm3r
 
Join Date: Jun 2003
Location: Glasgow, Scotland
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
ah, i dont think its possible to stream data in that way but ive never tried so im not sure. Possibly try:


Code:
<%
  While Not rs.EOF   
     For i=0 to rs.Fields.Count-1
       Response.Clear
       Response.ContentType="application/pdf"
       Response.AddHeader "content- disposition", "attachment;filename=some.pdf"
       Response.BinaryWrite rs.Fields(3)
     Next
     rs.MoveNext
   Wend
     Response.Write "<CENTER>"
     Response.Write "Record not found !!"
     Response.Write "</CENTER>"
%>
Reply With Quote
  #7 (permalink)  
Old 06-20-03, 07:57 PM
Gurrutello Gurrutello is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
hello
this is a commmon redirection problem
be sure to put all your asp main code before any html tags

if not try
server.transfer"your_url.asp"' if your server aloud you

saludos
Reply With Quote
  #8 (permalink)  
Old 06-22-03, 07:01 AM
bonnie bonnie is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy

I will try to add it! Thanks!!

But I want to confirm that "response.redirect" supports OLE Object or not??It only supports "URL"????In my ASP Page, the OLE Object is called.
Reply With Quote
  #9 (permalink)  
Old 06-23-03, 02:28 AM
bonnie bonnie is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy

I want to know something about "response.binarywrite". How can I perform an OLE object with it? Since I am confused on "response.redirect" and "response.binarywrite"
Reply With Quote
  #10 (permalink)  
Old 06-23-03, 01:45 PM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
response.redirect - uses the browser to redirect the user to a specific file
http://msdn.microsoft.com/library/de...om_resomre.asp

response.binarywrite - writes binary data to the http output.
http://msdn.microsoft.com/library/de...om_resombw.asp

In your example, you are trying to redirect the user to an OLE object. The OLE object is binary. You are trying to redirect the user to a specific URL that contains binary data. It just won't work that way.
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Connection error '800a0bb9' - HELP! seala ASP 1 03-09-05 05:37 AM
error when creating database tables with php script spiroth10 PHP 4 01-06-04 03:59 PM
getting -2147217900 error while inserting and updating skchakri ASP 3 09-20-03 10:34 AM
Can't find the error. Mister B. ASP 12 08-27-03 06:18 PM
Funny error returned. Mister B. ASP.NET 3 08-24-03 06:39 PM


All times are GMT -5. The time now is 03:59 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.