# CGI: triggering a file download & having a page appear

**URL:** <https://www.ruby-forum.com/t/cgi-triggering-a-file-download-having-a-page-appear/110824>\
**Category:** Ruby\
**Created:** [July 31, 2007, 11:35am UTC](https://www.ruby-forum.com/t/cgi-triggering-a-file-download-having-a-page-appear/110824 "2007-07-31T11:35:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![frocco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@frocco](https://www.ruby-forum.com/u/frocco)\
**Post date:** [July 31, 2007, 11:35am UTC](https://www.ruby-forum.com/t/cgi-triggering-a-file-download-having-a-page-appear/110824/1 "2007-07-31T11:35:26Z")

</div>

Hi,

I’m fairly new to fast-cgi/CGI programming and I have a particular  
problem:

When people click on a download link, I want the download to start (zip  
file) AND an installation page to appear that explains how to use the  
downloaded file.

This is easily done in JavaScript: show the installation page and  
trigger the download via the Body.onLoad handler, but it would be nicer  
to do it all on the server side…

Is there any way of triggering two HTTP responses for one request?

Thanks for your time.

Best regards,

Frank

---

<div class="post-metadata">

**Author:** ![frocco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@frocco](https://www.ruby-forum.com/u/frocco)\
**Post date:** [July 31, 2007, 11:44am UTC](https://www.ruby-forum.com/t/cgi-triggering-a-file-download-having-a-page-appear/110824/2 "2007-07-31T11:44:09Z")

</div>

2007/7/31, Frank R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> trigger the download via the Body.onLoad handler, but it would be nicer  
> to do it all on the server side…
> 
> Is there any way of triggering two HTTP responses for one request?

No. One request, one response. Maybe you can do a multipart response  
but I have no experience with that myself.

Kind regards

robert
