Active4D downloads document instead of displaying it in a browser window

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Active4D downloads document instead of displaying it in a browser window

David Ringsmuth-3
Please help!

Active4D downloads document instead of displaying it in a browser window

A4D 6.1r4
Window 7 Home Premium SP1 64bit
4D Server v13.5+

The same system (code, scripts, ini, libs, all.) runs correctly on my
development box. When I copy it to the client and run it there, A4D
downloads the document instead of displaying it in the browser window.

An older version of the same system works correct - the forms are display in
the browser.

I am positive that Active4D is processing the form because logging occurs
from within the form that is downloaded.

The last line processed before the form is download is:

<iframe name="classDisplay" id="classDisplay" src="programs_f.a4d?progname="
width="100%" scrolling="auto" align="top" frameborder="0" class="IFrame">
                                        This option will not work correctly.
Unfortunately, your browser does not support Inline Frames</iframe>

Inside the document, " programs_f.a4d" on the first line is a logging
command that does not execute - it does not appear in my logs.
//--------------------------------------------------------------------------
--------
//programs_f.a4d follows
//--------------------------------------------------------------------------
--------
<%
CM.Web_Log_A4D(CLN(current line number)+get query params)
Include("/1/header_f.htm")
Import("Programs_f")
if(undefined($revclass))
        $revclass:=""
end if
if(undefined($progname))
        $ProgName:=""
end if
if(undefined($loc))
        $Loc:=""
end if
Programs_f.Programs_f ($revclass;$progname;$loc)
Include ("/1/footer_if.htm")
%>
//--------------------------------------------------------------------------
--------
// The form that is (wrongly) downloaded follows
//--------------------------------------------------------------------------
--------


Cache-Control: no-cache
Pragma: no-cache
Expires: Thu, 16 Oct 2014 21:31:14 GMT
Set-Cookie: ACTIVE4D_SESSIONID=D6F53942FC51B705; Path=/; HttpOnly
Content-Length: 6047
Content-Type: text/html; charset=utf-8



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>


        <title>Jack Splash Swim School - Sartell, MN ClassManagerT Version
7.2.74</title>

        <meta http-equiv="Content-Style-Type" content="text/css">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="ROBOTS" content="NOINDEX">
        <meta name="ROBOTS" content="NOFOLLOW">
        <link href="stylesheet.css" type="text/css" rel="stylesheet">
        <link href="../stylesheet.css" type="text/css" rel="stylesheet">
        <meta name="description" content="Jack Splash Swim School strives to
create an environment that will foster an enjoyment and love of swimming
while teaching the skills that give the confidence and knowledge that helps
children to be safe in an aquatic environment. With both age and development
specific levels, students will see results.">
        <meta name="keywords" content="Jack Splash Swim School strives to
create an environment that will foster an enjoyment and love of swimming
while teaching the skills that give the confidence and knowledge that helps
children to be safe in an aquatic environment. With both age and development
specific levels, students will see results.">
<script language="javascript" type="text/javascript"><!--
function autofocus(){

}
//--></script>


<script language="JavaScript" type="text/javascript" >
if (top.frames.length!==0) {
        top.location=self.document.location; }
if (window.location.href !== window.top.location.href) {
        window.top.location.replace(window.location.href); }
function frame_buster() {
if (top.frames.length!==1) {
        top.location=self.document.location; }
if (window.location.href !== window.top.location.href) {
        window.top.location.replace(window.location.href); }
}
</script>
<script language="javascript" type="text/javascript">
function program_select (itemSel){
if(itemSel === 0 ) {
        document.getElementById("selection_display").selectedIndex = 0;}
if(undefined === itemSel) {
        if('' !== document.getElementById("selection_display").value) {
                parameter =
document.getElementById("selection_display").value;
       
frames['classDisplay'].location.href='/1/programs_f.a4d'+parameter;}
        }
}
</script>
</head>


<body >
<noscript><a
href="http://www.atlantic-associates.com/ClassManager.html">link</a></noscri
pt>
<noscript><a
href="http://www.atlantic-associates.com/TimeManager.html">link</a></noscrip
t>
<div id="rt-main-background"><input type="button" title=" Jack Splash Swim
School " value=" Jack Splash Swim School "
onclick="window.location='http://www.jacksplashswimschool.com/'" />
        <div class="rt-container">

                <div class="rt-surround">
                <div class="rt-surround2">
                        <div class="rt-surround3">
                        <div id="rt-main-surround">
                                <div id="rt-main" class="mb12">
                                <div class="rt-main-inner">
                                        <div class="rt-grid-12">
                                        <div class="rt-block">
                                                <div class="default">
                                                <div
class="rt-module-surround square1">

                                                        <div
class="rt-module-inner">
                                                        <div
id="rt-mainbody">
                                                                <div
class="rt-joomla">
                                                                <div
class="rt-blog">
<form name="classMgr" action="post">
<table class="classManagerContainer" width="100%">
        <tr height="3"><td colspan="9">&nbsp;</td>
        </tr>
        <tr>
                <td width="5%">&nbsp;</td>
                <td width="35%" class="clsSubHeading">To begin, select your
<span style="background-color: yellow;">Sartell, MN</span> Program of
interest...</td>
                <td width="5%">&nbsp;</td>
                <td width="15%" class="cm_header">&nbsp;
<!-- Active Web Programs: 68--><!-- Active Web Programs for selected
classes: 13-->
<select class="CMpop" id="selection_display" name="selection_display"
onchange="program_select();">
        <option class="CMpoprevclass" value="">Select Program</option>
        <option class="CMpoprevclass" value="?loc=&amp;revclass="
Selected>All Programs</option>

<option class="CMpoprevclass" value="?loc=&amp;revclass=Big_Reds" >Big
Reds</option>
       
<option class="CMpoprevclass" value="?loc=&amp;revclass=Great_Whites" >Great
Whites</option>
       
<option class="CMpoprevclass" value="?loc=&amp;revclass=Little_Blues"
>Little Blues</option>
       
<option class="CMpoprevclass" value="?loc=&amp;revclass=Little_Splashers"
>Little Splashers</option>
       
<option class="CMpoprevclass" value="?loc=&amp;revclass=Middle_Blues"
>Middle Blues</option>
       
</select>
                </td>
                <td width="5%">&nbsp;</td>
                <td class="cm_header" width="15%"><a
href="myschedule.a4d?loc=" target="classDisplay"
onclick="program_select(0);">Your Account Info</a></td>
                <td width="5%">&nbsp;</td>
       
               
                <td width="10%">&nbsp;</td>
       
                <td width="5%">&nbsp;</td>
        </tr>
        <tr>
                        <td colspan="9" height="1"
class="IFrameBorder"></td>
        </tr>
        <tr>
                <td width="100%" valign="top" colspan="9">
                                       
                                                <iframe name="classDisplay"
id="classDisplay" src="programs_f.a4d?progname=" width="100%"
scrolling="auto" align="top" frameborder="0" class="IFrame">
                                        This option will not work correctly.
Unfortunately, your browser does not support Inline Frames</iframe>
                                       
                </td>
        </tr>
</table>
</form>
                                                                </div>
                                                                </div>
                                                        </div>

                                                        <div
class="clear"></div>
                                                        </div>
                                                </div>
                                                </div>
                                        </div>
                                        </div>

                                        <div class="clear"></div>
                                </div>
                                </div>
                        </div>

                        <div id="rt-copyright">
                                <div class="rt-grid-12 rt-alpha rt-omega">
                                <div class="basic">
                                        <div class="rt-block">
                                        <div class="rt-module-surround">

                                                <div
class="rt-module-inner">
                                                <div class="module-content">
                                                        <div align="center">
                                                        <span style="color:
#c0c0c0;"><em>Copyright C 2014 Jack Splash Swim School. All Rights
Reserved..</em></span>
                                                </div>
                                                </div>

                                                <div
class="rt-module-bottom">
                                                <div
class="rt-module-bottom2">
                                                        <div
class="rt-module-bottom3"></div>
                                                </div>
                                                </div>
                                        </div>
                                        </div>
                                </div>
                                </div>

                                <div class="clear"></div>
                        </div>
                        </div>
                </div>
                </div>

        </div>
        </div>
</div>
</body>
</html>

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Active4D downloads document instead of displaying it in a browser window

Peter Jakobsson-2

On 16 Oct 2014, at 22:38, David Ringsmuth <[hidden email]> wrote:

> Active4D downloads document instead of displaying it in a browser window

I had this problem as well when I first started testing. Also running under 4D Client windows (but v14).

Are you using the latest version of the shell ? It contains a workaround for quirks in the 4D programmatic serving commands (WEB SEND RAW DATA, WEB SEND BLOB).

Have you checked the response headers using Safari’s developer suite or equivalent. I’ll try to think of more issues that I had. (There weren’t many but the few that were are a little time consuming to unravel).

Peter

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Active4D downloads document instead of displaying it in a browser window

David Ringsmuth-3
In reply to this post by David Ringsmuth-3
Peter,

Re: " Are you using the latest version of the shell ?"

Maybe not, I'll make sure I am and then respond...

If the shell update does not solve the problem, I'll look at the response
headers...

Thanks!!

David

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Peter
Jakobsson
Sent: Thursday, October 16, 2014 3:46 PM
To: Active4D Developer Discussion List
Subject: Re: [Active4d-dev] Active4D downloads document instead of
displaying it in a browser window


On 16 Oct 2014, at 22:38, David Ringsmuth <[hidden email]> wrote:

> Active4D downloads document instead of displaying it in a browser window

I had this problem as well when I first started testing. Also running under
4D Client windows (but v14).

Are you using the latest version of the shell ? It contains a workaround for
quirks in the 4D programmatic serving commands (WEB SEND RAW DATA, WEB SEND
BLOB).

Have you checked the response headers using Safari's developer suite or
equivalent. I'll try to think of more issues that I had. (There weren't many
but the few that were are a little time consuming to unravel).

Peter

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Active4D downloads document instead of displaying it in a browser window

David Ringsmuth-3
In reply to this post by David Ringsmuth-3
Peter, all,

I updated to the most recent A4D Shell - no joy.

About the headers, Chrome console reported:

Resource interpreted as Document but transferred with MIME type
application/octet-stream: "http://1.2.3.4/4dcgi/1/class_manager.a4d".

Nowhere do I find setting the MIME type to application/octet-stream?

I think this points to the problem. This is the declared setting:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

What might be converting the document to " application/octet-stream"?

David Ringsmuth

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Active4D downloads document instead of displaying it in a browser window

Peter Jakobsson-2

On 17 Oct 2014, at 04:08, David Ringsmuth <[hidden email]> wrote:

> Nowhere do I find setting the MIME type to application/octet-stream?

Hi David

Are you using fusebox ?

A couple of things to try:

[1] - Hack The Shell to Check the Response Header contains a “content-type"

You can put a little hack in the shell (A4D_OnWebConnection) to check the response header before it gets passed to 4D for transmission. Just before line 97 (where it checks the state of <>A4D_CanSendRawData), dump the contents of $responseHeaderNames and $responseHeaderValues to a text variable and call SET TEXT TO PASTEBOARD($responseDUMP). Then put a stopper (red dot) just after that and paste into a text editor.

You also need to do the same for the value of $contentType at line 118 in the case that <>A4D_CanSendRawData is false. Make sure that line 118 finds the content-type field in the array table ($i:=Find in array($responseHeaderNames;"Content-Type”).

At least that will tell you what the shell *thinks* it’s sending back and will detect any rogue response header modifications in your page scripts.

[2] - Check 4D’s Preferences

v14 is quite aggressive in restoring its default home page in the preferences. I notice myself having to reset this a lot more than in previous versions. 4D seems desperate to serve something. Make sure you’ve got it pointed to an empty webDecoy folder and clear out the default home page (set it to blank).

h.t.h.

Peter

P.S. I would set <>A4D_CanSendRawData to one thing or the other in code and not have it driven by the 4D version number. I realise why Aparajita did it this way - so that we wouldn’t have to think about it - but the fact is that it’s better to think about it. I just switched ours permanently to false regardless of the version. When 4D fix the bug in WEB SEND RAW DATA then I might switch it back.

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Active4D downloads document instead of displaying it in a browser window

David Ringsmuth-3
Peter!

THANK YOU!!

I set <>A4D_CanSendRawData to FALSE and tested as that seemed like the
fastest way to get an answer - and it worked!

:-D

...so busy - have to take the quickest path for now...

David Ringsmuth

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/