I have this:
open(MAIL,"|/usr/sbin/sendmail -t");
## Mail Header
print MAIL "To: $GLOB_OPT{email}\n";
print MAIL "From: $GLOB_OPT{from}\n";
print MAIL "Subject: $GLOB_OPT{sub}\n";
print MAIL qq|Content-Type: text/html; charset=us-ascii\n|;
print MAIL qq|Content-Transfer-Encoding: 7bit\n|;
print MAIL qq|MIME-Version: 1.0\n\n|;
print MAIL qq|<h3>Download File :</h3><br>|;
print MAIL qq|<a href="$GLOB_OPT{html}" rel="nofollow" target="_blank">Click Here</a>|;
close(MAIL);
I want to send the hyperlink to user so they can download the csv file in the $GLOB_OPT{html} path.
When I open the link in my email, it opens the csv in the browser. I want instead the browser to download the file. What can i do?
Try using content-disposition in http headers on the webserver’s side. This even works with .htaccess.
As far as I understand, the way you send the e-mail has little to do with the save/display choice in the browser.