|
Yes Mike, The Content-type: text/html must be the only thing on the line. "white space" is considered data and therefore screws up the interpretation of the header. You might thing the white space doesn't matter since there are blanks following the header on the line. But CGIDEV2 and CGILIB both trim off trailing blanks for performance reasons when sending source member records (as HTML) to standard output. But neither one trims off leading spaces. This is also why inserting a "blank line" just after the header is required... CGIDEV2/CGILIB simply send the X'25' after trimming off the white space, thus you get this sent: Content-type: text/html\n \n (Where \n = X'25') -Bob -----Original Message----- From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Mike Skvarenina Sent: Friday, October 22, 2004 9:28 AM To: 'Web Enabling the AS400 / iSeries' Subject: RE: [WEB400] Browser tries to download program OK, got it.... I didn't think whitespace before the "Content-type"... would make a difference. When I removed the whitespace and simply started the section with a 'C', it worked. Thank you all for your help! -----Original Message----- From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Mike Skvarenina Sent: Friday, October 22, 2004 10:19 AM To: 'Web Enabling the AS400 / iSeries' Subject: RE: [WEB400] Browser tries to download program Aaron, When you say to put it in the top of my CGIDEV2 template, are you saying it needs to be in one of my HTML sections, basically the one that starts off a page? I tried this and now when I view the source on my web page (as served from the Original server), I see what's below. Trying to load the same page using the Apache instance, still pops up the "file download" box... Content-Type: text/html <html> <head><meta http-equiv="content-type" content="text/html;charset=UTF-8"> ...rest of my web page... -----Original Message----- From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Bartell, Aaron L. (TC) Sent: Friday, October 22, 2004 10:05 AM To: Web Enabling the AS400 / iSeries Subject: RE: [WEB400] Browser tries to download program The HTTP headers have to be the first thing you send out. Put this in the top of your CGIDEV2 template: Content-Type: text/html <html><head></head><body></body></html> Make sure you press enter twice after the Content-Type: line. Aaron Bartell -----Original Message----- From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] Sent: Friday, October 22, 2004 8:54 AM To: 'Web Enabling the AS400 / iSeries' Subject: RE: [WEB400] Browser tries to download program Hmmm, SO what exactly am I suppose to to? I added the following to my HTML, right after the beginning of the <head> section but the browser is still not interpreting my pages as HTML <head><meta http-equiv="content-type" content="text/html;charset=UTF-8"> -----Original Message----- From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Joe Lee Sent: Thursday, October 21, 2004 8:30 PM To: web400@xxxxxxxxxxxx Subject: RE: [WEB400] Browser tries to download program HTML pages are sent to the browser from the web server as a HTTP response message. A HTTP response message includes 2 sections. The first section is the message header and consists on zero or more headers, probably the most commonly used of which is the "Content-type" header. The header section is followed by 2 CRLFs, which are followed by the message body. In your case the message body is an HTML document. However if there is no "Content-type" header the browser doesn't know that the message body is a HTML document, and since the extension is not .htm, .html, or something else that indicates that the message body is a HTML document, the browser doesn't know how to handle the message body and asks you where to save it. Strictly speaking the "Content-type" section isn't part of the HTML, though it is sent to the browser. It probably worked before because the IBM HTTP server (not based on APACHE) checked for a "Content-type" header and added one if it didn't exist. On the browser side you still won't see the "Content-type" section, however you should see the document as an HTML page in the browser, instead of a download. Joe Lee p.s. If you want to find out more about the HTTP messages take a look at RFC 2616. >>> mskvarenina@xxxxxxx 10/21/2004 19:32:50 >>> Finally, any additional thoughts on my problem? My previous HTML didn't have a content type section. I don't know how that would effect the web server itself as opposed to the browser. For example does the web server itself read the HTML then do something different/special when it sees a content type directive? _______________________________________________ This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/web400 or email: WEB400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/web400. _______________________________________________ This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/web400 or email: WEB400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/web400. _______________________________________________ This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/web400 or email: WEB400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/web400. _______________________________________________ This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/web400 or email: WEB400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/web400. _______________________________________________ This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/web400 or email: WEB400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.