当使用相同的名称使用laravel 5第二次上传图像时,但在浏览器上显示旧图像


When upload image second time using same name using laravel 5 but showing old image on browser

在上传之前检查文件是否存在,然后删除此图像并使用laravel功能上传新图像,但在浏览器上点击图像url时显示第一次上传的图像

当文件名和文件类型相同时,我遇到了这个问题。

在我的代码下面

$destinationPath = "public/".$destinationPath;
            $extension = $file->getClientOriginalExtension();
            if($file->isValid() && in_array($extension, $allowedExt)) {
                if ('File::exists($destinationPath.$fileName)) {
                    'File::delete($destinationPath.$fileName);
                }
                if($file->move($destinationPath, $fileName)) {
                    return true;
                }
            } return false;

我已经清除了所有缓存,并在另一台电脑上尝试。

以下命令用于清除缓存。

    请给我一些建议来解决这个问题

    我得到了答案。为什么不反映更新后的图像,因为在服务器端维护缓存,这是亚马逊提供的功能。

    我已经禁用了这个功能,现在它工作正常。

    我希望我的解决方案能对那些面临同样问题的人有所帮助。