Re: Changing content type



Aaron Fude wrote:
Thomas 'PointedEars' Lahn wrote:
Aaron Fude wrote:
I have a webpage delivers, let's say, a pdf document. The page is
password protected so itially it shows HTML, but when the user logs in
the page is reloaded with "window.location.reload(true)", but
IExplorer is not smart enough to realize that the content type has
changed and just spits out pdf onto the screen. How does one fix that?
Parse error. Please restate your request.

OK, fair enough. Let me try to approach this from this angle. Here's
pseudo code for my page on the server size.

Not a good idea, as noted in the FAQ. Even the URL for an uncommented test
case would have been more enlightening that this.

if (user.notLoggedIn()) {
present.html.login.form();
when (user.submits.login.information)
window.location.reload(true);
}

else { // Now that the user has logged in...
output.a.pdf.file();
}

What happens in this scenario is that rather than invoking the acrobat
reader, the raw contents of the html file are displayed on the screen.

Does that make better sense?

Unfortunately not. Suppose "size" was a typo for "side", hence this being
server-side J(ava)Script (.NET), then window.location.reload(true) would not
fit in as it is a client-side method. And if server-side scripting was not
meant with this, I wonder what client-side scripting would have to do with a
login, which should be secure. And even if made possible so in any way, why
would it be necessary to reload the entire document, discarding everything
done so far?

ISTM your approach is completely wrong, and you should read on how to built
a client-server Web application properly.


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
.



Relevant Pages

  • Re: A toughy.
    ... The reload took a long time and this is a fairly fast machine so maybe it fixed something. ... (For this one bug). ... I have always used HTML for my personal posts and the HTML doesn't seem to have that option. ... Paying users do not have this message in their emails. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Sinatra : examples and FRAME.
    ... but can also display the current data from the @variable. ... I 'm not good with HTML:( ... I can't show the selected value in the form without reload the page!? ... def html_select ...
    (comp.lang.ruby)
  • Re: thousands of pages added automatically
    ... >document as a web page and then reload the html back into ... >>In certain spots in the document when I add, ... >>modify, Word automatically adds thousands of pages. ...
    (microsoft.public.word.formatting.longdocs)
  • Re: False error message from ANT for Reload task
    ... I have a ANT script that execute a "reload" task on my Tomcat. ... ANT prints the HTML page usually returned by HTML ...
    (comp.lang.java.help)
  • Re: Changing content type
    ... password protected so itially it shows HTML, but when the user logs in ... IExplorer is not smart enough to realize that the content type has ...  Please restate your request. ... the raw contents of the html file are displayed on the screen. ...
    (comp.lang.javascript)