Automatically close page with URL redirector

0
I need to download a extra large file from AWS S3. To do this I generate a one time signed URL in a microflow and open a blank page with URL Redirector (https://appstore.home.mendix.com/link/app/113/) as the last activity of the microflow. The redirector works great, but I end up staring at a blank page. Ideally, I need to return back to the calling page, i.e. close the blank page with URL redirector. I suspect I need to initiate a microflow once the URL redirector completes its action. Can somebody guide me how to achieve this?
asked
2 answers
0

Maybe use the microflow timer widget: https://docs.mendix.com/appstore/widgets/microflow-timer

answered
0

I think this is a good use case for a JavaScript action. Here’s how I’d go about it:

  • Your process probably starts with the click of a button – use a nanoflow as the action here
  • In the nanoflow, build the S3 URL. If you need server-side logic to do that, call a microflow.
  • After the microflow call, call a JavaScript action. This should be a new JS action with a string parameter of the URL
  • In the action, use code like this: 

 

var link=document.createElement('a');
link.href=url;
link.click();

 

For S3 urls, I believe this will download the file vs. trying to render the URL directly. This worked in my quick test.

answered