Re: How to have email form send email and start file download
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: How to have email form send email and start file download

From: Thomas 'PointedEars' Lahn <PointedEars@web.de>
Date: Sun Apr 30 2006 - 19:08:05 CEST

bmurphy@xlrotor.com wrote:

> [...]
> When the site visitor fills out the form and submits it, this calls a
> rather ordinary asp script like formmail.asp that sends the emails and
> displays a "thank you" web page. At the very end of my "thank you" web
> page I placed the following:
>
> <script type="text/javascript">
> location.href="FileToDownload.exe"
> </script>
>
> This causes the file download to get triggered, and asks the user if
> they want to save the file. In limited testing this appears to work
> fine in both Firefox and IE.

If, and only if, the required client-side script and DOM support
is present. You are much better off doing this server-side. At
least provide a server-side fallback.

PointedEars

-- 
What one man can invent another can discover.
  -- Sherlock Holmes in Sir Arthur Conan Doyle's
     "The Adventure of the Dancing Men"
Received on Mon May 1 05:27:59 2006