我正在尝试存储和接收来自我的STACK存储(在raid服务器机架上)的图像。它旨在存储文件(特别是我的图像)。
所以我正在使用插件'Flysystem'和随附的Webdav插件。
现在,我用来获取单个文件的代码是:
public function GetImagesFromFolder($folder)
{
return Flysystem::listContents("TAC-Tielt-2013");
die;
$filename = basename('logo_small.png');
$file_extension = strtolower(substr(strrchr($filename,"."),1));
switch($file_extension) {
case "gif": $ctype="image/gif"; break;
case "png": $ctype="image/png"; break;
case "jpeg":
case "jpg": $ctype="image/jpeg"; break;
default:
}
return response(Flysystem::read('logo_small.png'))->header('Content-Type', $ctype);
}
这里唯一的问题是我需要从特定文件夹中获取所有文件......但是,这根本不起作用。
这是我的STACK结构:
http://image.prntscr.com/image/5b91d71e5c3444f0a0e53c1ec4dcdd49.png http://image.prntscr.com/image/fce1dc7f450c42758c7eef98b109a95e.png
我怎么想从中得到一切?我希望能够列出我的存储的“根”内的文件夹,然后在请求特定网址(文件夹名称)时,它显示所有图像。我怎么能这样做?