Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

uploaded image with same name does not reflect on page immediately

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have an upload function where i can upload image to server. However, if i upload an image with the same name, the page which load the image does not reflect on the newly uploaded image. Instead it loads the old image, note that the server already has the latest image.

I only manage to get the new image loaded on the page if i click the browser refresh button.

Can somebody assist me here? thanks
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if i upload an image with the same name, the page which load the image does not reflect on the newly uploaded image



you mean the page doesn't load again after invoke the upload method. are you using Ajax?
[ October 11, 2008: Message edited by: Muhammad Saifuddin ]
 
Derek Bright
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it actually only load the new image if i press refresh button. Say the image is my website banner, the 1st time i upload the image, name banner.jpg, it will immediately show after i click my save button.

However, if i change the banner with another different image, but name as banner.jpg (same as the 1st image), it will overwrite the old image in the server. The problem is, once i clicked save button, my banner is still the old image, not the newly uploaded image. Only by clicking the refresh button (F5), then it will load up the new image.

Hope i get this clear...thanks!
 
Greenhorn
Posts: 1
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am also having the same problem.

I have functionality of updating image of a user in his/her profile for my application.

I use the same name of an image after uploading the image at the time of editing image.

And again go to the user profile page to display modifications he/she has done.

But the user image is not updating and still shows the older one until I press (F5 or Ctlr+F5) in my JSP page.

(Note: I am not using Ajax at all and new image is saved in specified directory on server).

Thanks & Regards
Ashvin
 
Ranch Hand
Posts: 384
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it might be because of the BROWSER caching the image at the first go ... the first time you load the page.
Then when you replace the image with an image having the exact same name ... BROWSER first checks it's cached library then searches the HDD

 
What are you saying? I thought you said that Santa gave you that. And this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic