我正在使用dropzone在Laravel上載圖像。縮略圖底部的顯示文件名稱
有什麼方法可以在縮略圖的底部顯示圖像名稱?
我知道圖像名稱將在懸停到縮略圖時顯示,但我希望顯示縮略圖底部的文件名而不會懸停在縮略圖上。
代碼如下。
我的dropzone js在我的上傳頁面中。
Dropzone.options.imageUpload = {
paramName: "image", // The name that will be used to transfer the file
maxFilesize: 30, // MB
uploadMultiple: true,
clickable: true,
maxThumbnailFilesize: 30,
parallelUploads: 1,
maxFiles: 10,
dictMaxFilesExceeded: "This image is exceeded the limit upload",
init: function() {
this.on("queuecomplete", function(file) { $("#buttons").show(); });
},
accept: function(file, done) {
if (file.name == "justinbieber.jpg") {
done("Naha, you don't.");
}
else { done(); }
}
};
我上傳的控制器
$User = Auth::user()->id;
$category = Category::active()->first();
$sizeHeight = Size::orderBy('height', 'ASC')->where('status', 0)->first();
$sizeWidth = Size::orderBy('width', 'ASC')->where('status', 0)->first();
$files = $request->file('image');
if(!empty($files)):
$urls = array();
foreach($files as $val => $file):
$now = Carbon::now();
$time = str_replace(':', '-', $now);
//$number = $val + 1;
echo $sizeHeight;
echo $sizeWidth;
$filename = $file->getClientOriginalName();
//get image size
$filepath = $file->getRealPath();
list($width, $height) = getimagesize($filepath);
//if wrong orientation then
if($width >= $sizeWidth->width || $height >= $sizeHeight->height)
{
// Ryan 22 October 2016 (Saturday) move save photo to top
$photo = new photo;
$photo->user_id = $User;
$photo->photoName = $time . $filename;
$photo->category_id = $category->id;
$photo->subcategory_id = "1";
$photo->name = null;
$photo->keyword = null;
$photo->status = "2";
$photo->save();
}
endif;
這是我目前的結果,當我徘徊在縮略圖
,我希望它是這樣的,而不徘徊。
請幫助。
請添加一些代碼...... –
請分享您的代碼... –
@MinalChauhan我已經更新了我的代碼 –