Created
November 25, 2014 22:05
-
-
Save staylor/02fb932d12fe5786b8eb to your computer and use it in GitHub Desktop.
File download thing
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 | |
header( 'Cache-Control: no-cache, no-store' ); | |
header( 'User-Agent: My Cool Download Script' ); | |
header( 'Content-Disposition: inline; filename=TARGET_FILENAME_WITH_NO_PATH' ); | |
header( 'Content-type: MIME_TYPE_OF_FILE;charset=CHARSET_OF_FILE' ); | |
header( 'Vary: Accept-Encoding' ); | |
header( 'Keep-Alive: timeout=15, max=1024' ); | |
header( 'Connection: Keep-Alive' ); | |
// readfile() or echo contents of file, whatever | |
echo 'HELLO FILE CONTENTS'; | |
exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment