Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page refresh

Status
Not open for further replies.

rbeech23

Programmer
Dec 22, 2002
14
GB
I've an option on a web page to upload a photograph. This involves the user browsing his local drive for an image then clicking on upload. On success another page comes up displaying the photograph. All works fine. The user also has the option from this page to upload a different photograph. On clicking this option the user is taken back to the browse page, selects a different image and clicks upload. Whilst the file copy works the display page retains the old image. Only by doing a manual refresh does the new image get displayed. I want it to be refreshed automatically. I've tried using the various meta tags to prevent caching but none of these work.
It's a jsp page which sets up some java beans and includes the html file which generates the information.

Anyone have a rock solid mechanism to reload the page once on opening ?

I know javascript can do it but the posts I've seen do a refresh at a timed interval which is not quite what I want.

Any help appreciated

Thanks
 
You could do this:
<script>
<!--
if(document.referrer.indexOf(this.location.href)==-1){
this.window.href=this.window.href;
}
//-->
</script>

But keep in mind that not all users may have this problem. If you psot the url of the page here, I can check and see.

Rick -----------------------------------------------------------
RISTMO Designs
Arab Church
 
Thanks.
The site I'm developing is (note the capital W). The site goes live once I've ironed out odd bits like this.
You'll need two images to test what I'm on about, sizes should be less than 20Kb
You can log in using login user105 password pass123.
This takes you to the members area where you should click Upload Photographs.
Now use Browse to select your image followed by Upload. Your image should be displayed with a success message. From this page you have the option to upload another different photograph.
Click on this link which goes back the Browse option. Select your second image and click Upload.

You should now get the original image even though your new image will have been copied.

Clicking refresh will display your new image. This is what I'm trying to avoid. I guess because the html doesn't actually change may be contributing to my problem.

I want the new image to be displayed automatically.

Hope this helps, if you need any more information please let me know.

Thanks
 
The first time I tried to upload a .gif on mistake. It displayed the old image. You should have a message if the user tries to upload the wrong type of image. When I went back and did it right, it worked fine. I tested it with 2 .jpgs.

Rick -----------------------------------------------------------
RISTMO Designs
Arab Church
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top