【发布时间】:2018-12-21 04:26:29
【问题描述】:
我已成功更新个人资料图片,但在显示过程中显示旧。 我已经在上传的文件夹中检查了新图像已被替换。 请检查我的代码
<?php $filename=base_url().'profileimage/'.$this->session->userdata['user_details']['user_id'].'.jpg'; ?>
<img src="<?php echo $filename.'?='.filemtime($filename); ?>" class="rounded" alt="" width="150" height="150">
【问题讨论】:
-
我猜那是图片的缓存版本,试试 hard-reload 或
ctrl+f5 -
您正在使用 $filename 的会话,这意味着您必须在将图像成功上传到文件夹后更新会话的文件名。
标签: php image codeigniter session caching