Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
André Siébra
173
Views
6
Comments
How to redirect to a page after a Download?
Question
Hi guys,
I need the user to be redirect after it downloads a file. The scenario is: The user clicks on a button, the file is downloaded and right after a message is displayed and the page is redirected. Ive already tried a lot of things, but my scripts are not being executed when I put the
Download
endpoint in my action...
How can I achieve this? any ideas?
Kayala Sunil
André - I sincerely think you must be using the client side redirect.
From a preparation, the easyest way is using as destination a "ExternalSite" instead of the screen directly and
The GetEntryURL is a method from the HTTPRequestHandler extension. Just do a Add Remove References to add it.
To make it work you might have to clear the cache of your browser and the temp system %temp%
Another thing you can use the action MakeAbsoluteUrl() on the extension
HTTPRequestHandler
to garantee that your URL is always right in every environment ;)
1 reply
17 Nov 2015
Show thread
Hide thread
André Siébra
Kayala Sunil
wrote:
André - I sincerely think you must be using the client side redirect.
From a preparation, the easyest way is using as destination a "ExternalSite" instead of the screen directly and
The GetEntryURL is a method from the HTTPRequestHandler extension. Just do a Add Remove References to add it.
To make it work you might have to clear the cache of your browser and the temp system %temp%
Another thing you can use the action MakeAbsoluteUrl() on the extension
HTTPRequestHandler
to garantee that your URL is always right in every environment ;)
Hi Kayala. I've tried to redirect by this way.. no success. It's like João said,
it is not possible with a single page/action since the browser seems to kill my scripts
at the expense to
download...
João Rosado
Staff
Hi,
There are a couple topics on the forum regarding the subject.
The bottom line is: the way browsers handle downloads it is not possible with a single page/action.
That is why almost all sites redirect to pages with "download starting in a few seconds" as workarounds.
This
topic
has a solution like that.
There are also some solutions that involve having having javascript
clicking and invisible link
, but they are a bit tricky and browser dependent. I've seen some bowsers in the past just abort all javascript running in the page when they get a download ...so that breaks most solution attempts that do not involve extra pages/tabs/iframes.
Regards,
João Rosado
1 reply
17 Nov 2015
Show thread
Hide thread
André Siébra
João Rosado
wrote:
Hi,
There are a couple topics on the forum regarding the subject.
The bottom line is: the way browsers handle downloads it is not possible with a single page/action.
That is why almost all sites redirect to pages with "download starting in a few seconds" as workarounds.
This
topic
has a solution like that.
There are also some solutions that involve having having javascript
clicking and invisible link
, but they are a bit tricky and browser dependent. I've seen some bowsers in the past just abort all javascript running in the page when they get a download ...so that breaks most solution attempts that do not involve extra pages/tabs/iframes.
Regards,
João Rosado
João, I've already tried the insvisible link trick, but as you well said, no success.. I'll take a look at that topic or try the second page workaround.
Thanks!
Kayala Sunil
André - then I think we must use some sort of javascript which can be called in for the event... Sometimes very simple operations takes hellava time in OS...
J.
MVP
err no,
like joao said. redirecting after a download is not simple by default.
Nothing to do with outsystems
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...