I have a form that allows a user to upload an image file. The last image to be uploaded is visible on this form. This image file is renamed to the same name everytime the upload occurs and is placed in the same directory. So for example a user can upload any image but it will always be renamed to "mypic.jpg" overriding the previous image and dumped into a "/upload" directory. The problem is that when a new image is uploaded, because it has the same name as the old image, the old image is still displayed due to caching after a new image has been uploaded. If I hit refresh it will then display the latest image. I am using ASP as my server side language and have included its non-caching code :
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>
and I have also added the HTML non caching code :
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
These have no effect, is there anyway I can force the browser to get the latest version of the image?