Solved 2.0 fileupload and image overwritting

Posted on 2007-07-23
Last Modified: 2013-11-07
Hi Experts,

Controls used: Asp file upload control , 2.0,IE/Mozilla

Newly uploaded Image doesnt appear on the browser window even after refreshing the page, if I upload a different image with the same filename as the previously uploaded one.

1)     I have uploaded bipin.jpg to the server and preview displays bipin.jpg

2)     I have changed an existing image rohan.jpg to the server and preview displays rohan.jpg

3)     I have changed the name of rohan.jpg to bipin.jpg and try uploading and now the image displayed in the browser is still that of bipin.jpgs last content.(ideally it should display the photo of rohan as I just changed the image file name of rohans image to bipin)

I have tried with clearing cache in browser as well as in code but didn't work. please can you suggest me the solution for this weired behavior?

Question by:Swapnil Piparia
    LVL 12

    Accepted Solution

    Seems like a cahing problem!! That is when ever you dont hav any change in URL it will show cached image !! To avoid this you can just pass a random number as Querystring!! Better pass GUID as Query string while refering URL

    LVL 16

    Author Comment

    by:Swapnil Piparia

    I have ?t=+ Guid.NewGuid().ToString() appended in URL.

    Thanks Renju, It works.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    A Change in PHP Behavior with Session Write Short Circuit ( (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
    If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o… provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
    Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now