smartReadFile icon indicating copy to clipboard operation
smartReadFile copied to clipboard

Add option to break MIME and force download

Open thepag opened this issue 11 years ago • 0 comments

So that this can be used to initiate downloads of the file.

Something like:

if($_GET['download'] !== null) {
  $type = 'application/octet-stream'
} else {
  switch ($file[count($file)-1]) {
    case 'mp3':
    $type = 'audio/mpeg';
    break;
    // All the other types...
  }
}

The idea being that we can simply give the download url parameter and the MIME type will be broken to trigger the browser to download it instead of trying to play it.

thepag avatar Mar 14 '14 17:03 thepag