| 
 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] 
 |