downloading file

i have my website running onApache server. all cgi scripts under cgi-bin
i have a .bin under cgi-bin which is for downloading...
on my home page, i want a link, when the customer clicks this link, he sahould be able to download the .bin and save it on his local machine. how can i achieve this using cgi
perlperlAsked:
Who is Participating?
 
ahoffmannCommented:
your CGI has to read the file and then write it on stdout prepended by a proper HTTP header
The HTTP header should contain a  Content-Type:  
Depending on that content type the browser provides a dialog to save the file.
0
 
ahoffmannCommented:
why would you use cgi and not a direct link to your .bin file?
0
 
perlperlAuthor Commented:
the reason i don't want the link is because, first i do some processing, and then i want to the file to be saved on users's local machine
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.