We are trying to display azure file share in php laravel web application using scandir function. The functionality is working fine with on prem fileshare and application server fileshare. This is not working with azure fileshare even we have access to fileshare. We are able to access fileshare from the browser and we are able to upload files into azure filesshare from the same application. only Issues is when are trying to display fileshare. The Image is attached. Please give me the solution for this.enter image description here
$this->var['folder'] = $folder;
$this->var['parent'] = '';
$dir = filesharepath
if (!is_null($folder)) {
$exploded_folder = explode('/', $folder);
foreach ($exploded_folder as $key => $value) {
$dir .= '\\'.$value;
}
unset($exploded_folder[count($exploded_folder)-1]);
$this->var['parent'] = $exploded_folder;
}
$scannedfile = array_diff(scandir($dir), array('..', '.'));
$directories = [];
$file_list = [];
foreach ($scannedfile as $file) {
if(($file != '.') && ($file != '..')){
if(($file != '.') && ($file != '..')){
if(is_dir($dir.'/'.$file)){
$directories[] = [
'name' => $file,
'last_modified' => date("d F Y", filemtime($dir."\\".$file)),
'filetype' => 'directory'
];
}else{
$file_list[] = [
'name' => $file,
'last_modified' => date("d F Y", filemtime($dir."\\".$file)),
'filetype' => pathinfo($dir."\\".$file, PATHINFO_EXTENSION)
];
}
}
}
}
$this->var['file_list'] = $file_list;
$this->var['directories'] = $directories;
return view($this->var["_autoload_template"], $this->var);
we tries with the above code. Its not working. Please let me know the solution for this