jeudi 25 août 2016

Laravel 5.1 Catching FTP File not found exception

I want to download a file using FTP with Laravel 5.1, and I want to check if the file exists in the remote folder. I included use Illuminate\Contracts\Filesystem\Filesystem but it fails to catch the exception with the following error: [Illuminate\Contracts\Filesystem\FileNotFoundException]
p25082016.csv

My code looks like this:


    private function getFile()
    {
        try {
       // CONNECT TO FTP AND GET THE FILE
        } catch (FileNotFoundException $exception)  {
        die('File: '.$filename.' error');
        }
        return 'File: '.$filename.' OK';

    }

Any help?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire