lundi 23 mai 2016

How to allow download just .zip and exe [Laravel 5.1]

How can I allow that user be able just to download zip and exe files?

I am currently use this function:

public function download($id)
    {
        $headers = array(
            'Content-Type: application/x-msdownload',
            'Content-Type: application/zip'
        );

        return response()->download(storage_path() . '/app/' . 'gamers.png', 'gamers.png', $headers);
    }

And this allow me download any file, how can I limit it just on zip and exe?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire