Re: Changing content type
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Fri, 18 Jul 2008 00:33:18 +0200
Aaron Fude wrote:
Thomas 'PointedEars' Lahn wrote:
Aaron Fude wrote:
I have a webpage delivers, let's say, a pdf document. The page isParse error. Please restate your request.
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?
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
.
- References:
- Changing content type
- From: Aaron Fude
- Re: Changing content type
- From: Thomas 'PointedEars' Lahn
- Re: Changing content type
- From: Aaron Fude
- Changing content type
- Prev by Date: Re: Calling a function when passing no parameters
- Next by Date: Re: Calling a function when passing no parameters
- Previous by thread: Re: Changing content type
- Next by thread: Re: Changing content type
- Index(es):
Relevant Pages
|