473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Image not refreshing

Ken
How does IE6 control the display of images?

I change the content of a image file image1.jpg without changing the file
name. Then jump to a new page to display it.

IE6 does not displays the original picture, not the new image.

If I press F5, the correct image is displayed.

I tried:

session_cache_limiter('nocache');
session_start();
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-modified: ".gmdate("D, dMYH:i:s")."GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

with no success.

The echoed file name is correct.
The file on the server has the correct picture (content).

Where is IE6 getting the info (image1.jpg) for the picture?

How do I force IE6 to display the new picture?

Is there a PHP command that simulate pressing F5?

Ken

How do I force IE6
Jul 17 '05 #1
6 3532
*** Ken escribió/wrote (Thu, 16 Sep 2004 17:45:23 GMT):
session_cache_limiter('nocache');
session_start();
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-modified: ".gmdate("D, dMYH:i:s")."GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

with no success.
These headers only apply to the document in which you use them. Do you
generate pictures with a PHP script?
Where is IE6 getting the info (image1.jpg) for the picture?


Supposedly, from the web server response headers, given that it's
configured to check if the file has changed. You can find out in "Internet
Options-> Temporaty Internet Files-> Configuration"

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #2
Ken
"Alvaro G. Vicario" <kA*****************@terra.es> wrote in message
news:15*****************************@40tude.net...
*** Ken escribió/wrote (Thu, 16 Sep 2004 17:45:23 GMT):
session_cache_limiter('nocache');
session_start();
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-modified: ".gmdate("D, dMYH:i:s")."GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

with no success.
These headers only apply to the document in which you use them.

I added the above script to the page which displays the pictures with no
success.
Do you generate pictures with a PHP script? PHP handles the picture input and conversion (picture9 to new_file_name) to
a different name.
<input type=file size=65 name="picture9" Id="pt9">
<img src="<?php echo $_SESSION['new_file_name'];?> " border="0" width="100">
Supposedly, from the web server response headers, given that it's configured to check if the file has changed.
Is the image file name part of the web server response header or does the
header force the webpage to look else where for the actual file. The actual
file on the server has the correct content, but IE is not requesting an
update since the file name has not changed.

Is the web server making the determination if the file has changed?
Should I be looking for commands for the web server?
or
Is the browser making the determination?
Should I be look for commands for the browser?

Are there commands to control the web server response?
You can find out in "Internet Options-> Temporary Internet Files->

Configuration"

My computer is set for automatic. If I set it for "every visit to page" the
picture display properly.

Unfortunately, I cannot change the selected setting on the web page viewers.
So I am looking for a PHP command to force the page to "Check for newer
version of stored page for each visit".

Can this be done?

Ken
Jul 17 '05 #3
*** Ken escribió/wrote (Thu, 16 Sep 2004 19:38:47 GMT):
Do you generate pictures with a PHP script? PHP handles the picture input and conversion (picture9 to new_file_name) to
a different name.
<input type=file size=65 name="picture9" Id="pt9">
<img src="<?php echo $_SESSION['new_file_name'];?> " border="0" width="100">


Pictures aren't embedded in HTML documents, they're simply linked. If you
tell the browser that current HTML file expires, that won't affected linked
files.
My computer is set for automatic. If I set it for "every visit to page" the
picture display properly.
Then the web server is configured correctly.
Unfortunately, I cannot change the selected setting on the web page viewers.
So I am looking for a PHP command to force the page to "Check for newer
version of stored page for each visit".


I can't understand why you need to change pictures in the middle of the
browsing session. The simpliest solution that may work is adding a random
parameter to each link:

<img src="picture.jpg?foo=<?=$random_string?>">
--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #4
>My computer is set for automatic. If I set it for "every visit to page" the
picture display properly.


I've seen the same problem, and it appears to be IE that causes the
problems. I haven't seen the same problems with Firefox.

I guess this is one of those cases where you have to remember that
Microsoft stopped developing IE in 2002, and we should all be telling
the world to use FireFox instead...
Jonathan Beckett (jo********@pluggedout.com)
working on : http://www.pluggedout.com/penpals
Jul 17 '05 #5
>How does IE6 control the display of images?

I change the content of a image file image1.jpg without changing the file
name. Then jump to a new page to display it.
What happens if you use the following .htaccess commands
so they apply to the image (not the file with the <img src=...>):
(I'm assuming the server is Apache; I don't know how to get the
equivalent out of other servers):

ExpiresActive On
ExpiresByType image/jpeg "access plus 1 second"

I don't think Apache will accept "access minus 1 year". I'm not
sure about "access plus 0 seconds".

The idea here is that you get the headers on the IMAGE, not on the
page with the <img src= ...> in it.
IE6 does not displays the original picture, not the new image.
If it doesn't display the original picture, and it doesn't
display the new image, what DOES it do?
Where is IE6 getting the info (image1.jpg) for the picture?
Probably out of its cache.

How do I force IE6 to display the new picture?


How about this: create a new file image1.php, which outputs
headers and then outputs the image file. Change your references
to image1.jpg to image1.php in other pages.

<?php
header("Content-type: image/jpeg");
header("Content-length: " . filesize("image1.jpg"));
header("Expires: 1 Jan 1990 00:00:00 GMT");
header("Pragma: no-cache");
header("Cache-control: no-cache, no-store, must-revalidate");
header("Cache-control: pre-check=0,post-check=0", false);
... more headers here if desired ...

$fp = fopen("image1.jpg", "rb");
fpassthru($fp);
exit;
?>

Most of the stuff above is derived from the PHP site description
of the header() and fpassthru() functions.

If you are generating an image that is specific to the user, for
example, a graph of how HIS stock portfolio is doing, I'd recommend
NOT saving the image in a file, just generate and output it
when the image1.php file is called. It does reduce problems if
there are multiple users all looking at the same pages (but expecting
to see THEIR data in them) at the same time. If, on the other hand,
this image is something that stays the same for everyone (e.g.
a graph of a well-known stock market index) it may not be an issue.

This technique is reportedly used by pay sites also, except that the
PHP doesn't necessarily add headers, it validates your login instead
and directs you to a login/signup page if you aren't logged in.

Gordon L. Burditt
Jul 17 '05 #6
Ken
"Alvaro G. Vicario" <kA*****************@terra.es> wrote in message
news:1n*****************************@40tude.net...
*** Ken escribió/wrote (Thu, 16 Sep 2004 19:38:47 GMT):
Do you generate pictures with a PHP script? PHP handles the picture input and conversion (picture9 to new_file_name) to a different name.
<input type=file size=65 name="picture9" Id="pt9">
<img src="<?php echo $_SESSION['new_file_name'];?> " border="0" width="100">
Pictures aren't embedded in HTML documents, they're simply linked. If you
tell the browser that current HTML file expires, that won't affected linked files.
My computer is set for automatic. If I set it for "every visit to page"
the picture display properly.


Then the web server is configured correctly.
Unfortunately, I cannot change the selected setting on the web page viewers. So I am looking for a PHP command to force the page to "Check for newer
version of stored page for each visit".


I can't understand why you need to change pictures in the middle of the
browsing session. The simpliest solution that may work is adding a random
parameter to each link:

<img src="picture.jpg?foo=<?=$random_string?>">
--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la

intemperie) ++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions


Thanks Alvaro,

This worked.

Great idea.

Ken
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jdi | last post by:
Hello, I have a seemingly basic question about ASP.NET. I would like to create a page containing an image, which keeps swapping the url of the image source, without refreshing the entire page. ...
0
by: Jeronimo Bertran | last post by:
Hi, I have a page that includes an image that uses an image map. When the user clicks on a button, the image needs to be refreshed and the map needs to be updated without refreshing the entire...
6
by: Suraj Joneja | last post by:
Hi All, I've an image control on my ASP.net page. This displays an image named 'Logo.jpg' in the location '~\Images'. Another application can change this image. It can select any image and...
6
by: Mark Denardo | last post by:
I created a Web Image "<asp:Image ID="Image1" ..." that my code behind set to a certain image file say image1.jpg =Image1.ImageUrl = "<rel_path>/image1.jpg"; which set the image ok, but then I...
9
by: Mark Denardo | last post by:
This is related to another post I submitted, but I'll be more precise this time. I have a web page that contains an Image webcontrol that loads its image by: Image1.ImageUrl="<username>.jpg",...
4
by: ameyas | last post by:
hi all, i am using an image which has image map and i provide the href action url. i have provided the url to open a pop up window like "javascript:window.open('www.google.com');" but on...
1
by: pdesai007 | last post by:
hello, i tried to upload an image in to server with asp and java script ( using AJAX) but it gave an error. so please give me any solution that help me to upload an image to server with java...
1
by: Kirthikaiitm | last post by:
Hi, I have a image button (APPLY) On clicking apply button how to move the content from textbox to another textarea. I wrote the code in JScript. But once i click APPLY button the form is...
6
by: gopim | last post by:
hi, i have a problem. i am saving bitmaptextimage dynamically in data/image1.jpg every time when i redirect to the image.aspx page and i am assignning this image url to the image control.but image...
2
by: mukeshrasm | last post by:
Hi I am printing some text on image dynamically. I am setting the font size and type dynamically and then displaying to other page. Thing is that it is not displaying the image when I click submit...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.