Reloading image after upload

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bnashenas1984
    Contributor
    • Sep 2007
    • 257

    Reloading image after upload

    Hi everyone
    I have a script which lets users upload their own thumbnail.
    The users photo gets resized to 50 x 50 pixels when the upload is finnished.

    But the problem is that when the user uploads and changes the thumb the new image is not loaded by the browser and it still shows the old one until the user refreshes the page.

    This happens because I use the same image name for thumbs. For example if users ID on the database is 53 the thumb name will be 53.jpg

    I know it would work if I change the file name each time the user uploads the file but the website is now up and runing so its almost impossible to change all of these images.

    Is there any way to reload the image when the user uploads a new photo?


    Any suggestions will be appreciated

    Thanks / Behzad
  • HaLo2FrEeEk
    Contributor
    • Feb 2007
    • 404

    #2
    Well what's happening, I think, is the image is being saved into the user's cache. Let me clarify, your user uploads an image of an arbitrary size, say 115x115, and your script resizes it to 50x50 for them? Well, is the 115x115 (original) image ever displayed to the user? Is it ever shown in it's original form? If it is then you need to avoid that, if not then there's no reason that it should be cached by the client's browser.

    I need a little more information before I can totally understand this.

    Comment

    • bnashenas1984
      Contributor
      • Sep 2007
      • 257

      #3
      Thanks HaLo2FrEeK for the quick reply.
      The original photo is never showed or even saved anywhere. I save the resized image in a folder then I show it next to the users name. (when logged in)

      I'm not sure if I can post a link to my website here..
      Anyways, If I'm not moderators will remove it
      Here is the link to my website you can take a look :


      My script works fine but the only problem is that the browser caches the image and the page should be refreshed to show the new image.

      As I remember there is some kind of HTML or JAVA script to reload the image but I don't know how.

      Thanks again

      Comment

      Working...