473,795 Members | 2,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_l imiter('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 3561
*** Ken escribió/wrote (Thu, 16 Sep 2004 17:45:23 GMT):
session_cache_l imiter('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.n et...
*** Ken escribió/wrote (Thu, 16 Sep 2004 17:45:23 GMT):
session_cache_l imiter('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.jp g?foo=<?=$rando m_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********@plu ggedout.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("image 1.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.j pg", "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.n et...
*** 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.jp g?foo=<?=$rando m_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
2546
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. So when the page first loads I'd like the image url to be "img1.gif"; then 20 seconds later "img2.gif"; then "img3.gif", and so on. All this should take place dynamically without refreshing the page. Any help would be appreciated.
0
1323
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 form. <img id="mapimage" src="renderimage.aspx?param=1" usemap="#mappoints"> <map name ="mappoints> <area......> </map>
6
2520
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 upload to the folder 'Images' and newly selected image would overwrite existing image 'Logo.jpg'. (Image name remains same and image changes). The image control on my page doesn't refresh the newly selected image. it displays the old image where as the...
6
5022
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 replaced that image file with another image file and gave it the same name "image1.jpg". But my web app when it loads the image when I run the page still shows the original picture that I deleted and replaced with the new one, even though I...
9
1871
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", and an option for the user to update the photo. If they click the update button, I then flip up a new panel, where I have a FileUpload control and corresponding Upload Button. If they load an image file and click the Upload button, my code uses...
4
5169
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 clicking the image, the page (main window) gets refreshed in the background the pop up opens as desired. is there a way to cancel the refreshing of page ? i tried
1
2393
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 script and whithot refreshing of my page. thank you
1
2657
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 getting refreshed and the content in test area get vanished. How to retain the value on text area or how to avoid refreshing form on clicking image APPLY button.My button is <input type="image" src=/images/...> Pls. help regards, Kirthika
6
1824
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 is not refreshing.if we press F5 or REFRESH button then image is refreshing. i have used following techniques Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now-new TimeSpan(1,0,0));...
2
1340
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 button but when I refresh the page Image as well as Text is dispalyed as I wanted. So why It is displaying after refreshing the page
0
10438
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.