Photos won't refresh after upload

I'm uploading photos in a form, then edit, and upload again, but shows the same photo until I refresh the page. Everything I find for pragma no-cache is for IE 4 or 5? Whats the deal?
How can I have my page show the newest image that I most recently uploaded? Is there a way to do with coldfusion? or maybe even htaccess?
monosythAsked:
Who is Participating?
 
Gurvinder Pal SinghCommented:
check the second last reply of the thread in this link
http://www.neowin.net/forum/topic/513381-javascript-image-refresh/
0
 
Gurvinder Pal SinghCommented:
did you tried removing that image element and creating the same again?

Also try this

document.getElementById("imgId").src = document.getElementById("imgId").src;

where 'imgId' is the id of the image
0
 
Gurvinder Pal SinghCommented:
please try this one liner code in following link

http://snipplr.com/view/17272/single-line-image-refresh/
0
 
monosythAuthor Commented:
I ended up using something similiar to that:

<img src="/img/photo1.jpg?newest=#now()#">

where now() is the date down to the millisecond and browser thinks its a new image everytime.
0
 
Gurvinder Pal SinghCommented:
Thanks for the points
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.