Hi all!
I have made a page with an input "file" field for the user to be able to upload an image.
I have made an php script that takes care of the checking of the file and saves it to the server.
The problem is that the browser caches the images so when you upload a new image, the old image is still displayed after upload.
How do I make the browser to refresh the image??
Many thanks in advance!!

Marcux

Hi ,
I have never really worked with PHP before, but i think the way this could work is , whenever the user uploads a file, then the feild should be reset before uplaoding. This way the previous file path/value saved in it will be deleted and the image will not be cached.
Hope this helps.

Himi

You can control cache in php with headers. Here's a good read.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.