Link to home
Start Free TrialLog in
Avatar of nevyana2006
nevyana2006

asked on

Auto refresh Image

Hello,
I am using an ASP script which reads the contents of a folder with image files and outputs its content to the client. I am trying to make it auto refresh but it only works if the refresh is requested from the browser. I have added the following content, but does not work. Since the client is getting a HTML response, I have added a refresh meta tag (<META HTTP-EQUIV=refresh CONTENT=10;URL=http://webphone.nsgtmo.com/photopage.asp>) which seems to reload the page but does not re-run the code.
Response.Expires = -1
REsponse.ExpiresAbsolute = Now() -2
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "cache-control","Private"
Response.CacheControl = "private"
Response.AddHeader "Refresh", "10;URL=http://webphone.nsgtmo.com/photopage.asp"
ASKER CERTIFIED SOLUTION
Avatar of Ted Bouskill
Ted Bouskill
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Rerun which code?  So you don't see new image files added to the directory after the page loaded last?  You and the expert above are right that the browser has to request the refresh, it doesn't really come from the server directly.  The server can't "push" the page, at least without different technology.
Let me know how this helps or if you have a question.
bol
Avatar of nevyana2006
nevyana2006

ASKER

Yes, you are right. If I installed an add-on to the IE browser and set it up to reload the page it will reload it and display the updated images in the folder to the client. I added (found this on another problem) a javascript code <script>setTimeout('location.reload()',60000);</script> in the HTML response and that enabled the reload on the clients IE browser without an add-on. This is strange as ASP is native to IE....
That will only work if the image doesn't have an expiration value set in the header.  If it does the refresh will NOT download a new image.
http:#a22218669 was an appropriate answer.
Edited URL above - b0lsc0tt ZAPE

Open in new window