Skip to content

Add option to break MIME and force download #2

Description

@thepag

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions