Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 147
  • Last Modified:

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
0
perlperl
Asked:
perlperl
  • 2
1 Solution
 
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
 
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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now