You are here: Re: Cache issue when updating image file « PHP Programming Language « IT news, forums, messages
Re: Cache issue when updating image file

Posted by R. Rajesh Jeba Anbiah on 05/06/06 22:04

thehuby wrote:
> I am building a CMS and as part of it a user can upload an image.
>
> Once uploaded I am displaying the image.
>
> If the user then decides they want to replace the image with another I
> get a caching issue in the browser as the image has the same name.
>
> Without having to use unique file names each time the user replaces an
> image, how can I force the browser to check for the file properly?

Quick dirty hack is to append a random number to the image like
<img src="foo.jpg?999" />-- so that the browser will think it always
getting different image.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация