# Set headers
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".$file['original_filename']);
header("Content-Type: application/octet-stream");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($absolute_path));
ob_clean();
flush();
# Read the file from disk
readfile($absolute_path);
$file['download_path'] = "http://".$file['hostname']."/download.php?token=".$token;
<img style="margin: 15px; max-width: 870px" src="<?php echo $file['download_path']; ?>" alt="<?php echo $file['original_filename']; ?>" />
Photo.php
# Set headers
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".$file['original_filename']);
header("Content-Type: application/octet-stream");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($absolute_path));
ob_clean();
flush();
# Read the file from disk
readfile($absolute_path);
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".$file['original_filename']);
header('Content-Type: '.$file['mimetype']);
# Read the file from disk
readfile($absolute_path);
$absolute_path = "/home/fs01/uploads/2012/12/31/v3hbspfc9d_image.jpg";
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".basename($absolute_path));
header('Content-Type: application/octet-stream');
# Read the file from disk
readfile($absolute_path);
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".basename($absolute_path));
header('Content-Type: '.$file['mimetype']);
# Read the file from disk
readfile($absolute_path);