English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Forcing the refreshing an image ?
When downloading an image, browsers store these in the temp folder, so if you refresh the page, it picks the image already downloaded and saved on your machine.
I want to dowload the SAME filename image, but images will be different each time. How can I make sure that it is the NEW image that is displayed, and NOT the one internally stored ? (sort of "kill the old, reload the new")
Thanks for answers, but no: it is not up to the surfer to refresh the image: it MUST be in the HTML, java or php code. (some java setting of "life" of an object?)

2007-09-15 00:18:09 · 3 answers · asked by just "JR" 7 in Computers & Internet Programming & Design

3 answers

You need to send a header with the file to avoid it being cached.

You're generating a new image each time it's requested, right? Your applet that does that should have a name like nphdoimage - it needs to have nph as the first three letters - and it needs to send the headers correctly.

Content-type: image/jpg
Cache-control: no-cache

The headers should be one per line, and there needs to be a blank line after the last header. Write your image (in binary mode) to stdout. Be sure to exit at the end of your program.

In your .htaccess or httpd.conf file, you need to specify an AddType directive for the file that you're sending, something that isn't any known type, so that you don't have conflicts. Then you use an AddHandler directive to specify your NPH executable as the handler for that strange new file type.

Sounds a lot tougher than it is. I was completely confused the first time I tried to do this, but ended up with something that worked perfectly within 90 minutes.

2007-09-15 00:42:54 · answer #1 · answered by Anonymous · 0 0

it says save image as ie: "clip 1 jpeg" in your pictures folder ,but sometimes multiple pictures have the same
filename for some reason,so it will say you allready have a image file clip1jpeg do you want to overite the existing one? yes=it will delete the previous image and dload the new pic and the option no~or cancel= aborts dloading the new pic over the old one and you keep the old one
so how i get around this is change the name of the image file each time to ie:clip2jpeg,clip3jpg or anything you like even>1qwzxa

2007-09-15 00:42:01 · answer #2 · answered by Anonymous · 0 0

make the same filename image but add a number like 1,2,3,4,5,6,7,8 and so on that way u will no which one is what

2007-09-15 00:28:01 · answer #3 · answered by william l 4 · 0 0

fedest.com, questions and answers