Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to break MIME and force download #2

Open
thepag opened this issue Mar 14, 2014 · 0 comments
Open

Add option to break MIME and force download #2

thepag opened this issue Mar 14, 2014 · 0 comments

Comments

@thepag
Copy link
Member

thepag commented Mar 14, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant