Last active
April 24, 2018 12:12
-
-
Save tacoberu/00217d18e583d73c5afb69e06c2a4257 to your computer and use it in GitHub Desktop.
Firefox, Chrome, Safary ...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = __dir__ . '/file-1.jpg'; | |
header('Content-Description: File Transfer'); | |
header("Content-Length: ".filesize($file)); | |
header("Content-Disposition: attachment; filename=\"" . basename($file) . "\";"); | |
readfile($file); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="description" content=""> | |
<title>Test</title> | |
</head> | |
<body> | |
<div id="header"> | |
<h1>Test</h1> | |
</div> | |
<div id="container"> | |
<ul> | |
<li><a href="download.php" download>Download</a></li> | |
</ul> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment