mardi 7 février 2017

Laravel 5.3 store and read file directories

Currently trying to play about with files but struggling to figure out where to put them and how to read them back in a list.

Ive tried putting few test files into

$files = array();
$dir = opendir(asset('files'); // open the cwd..also do an err check.
while(false != ($file = readdir($dir))) {
    if(($file != ".") and ($file != "..") and ($file != "index.php")) {
            $files[] = $file; // put in array.
    }   
}

but it just returns blank despite having 3 test files in it.

Looked into larval recipes and suggestions say File:allFile() which isn't a supported method but its got me wondering apart from how to read files from a directory, where should i be really storing files I'm going to have on a server.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ll6b1r
via IFTTT

Aucun commentaire:

Enregistrer un commentaire