Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to get latest Image from folder using javascript?
    text
    copied!<p>I am using jquery's Uploadify to upload images on server. Now what i am doing when user successfully upload a image, i want to replace this image with the old one. for that i am binding the image <strong>onsuccess</strong> method of uploadify, it is working fine if the image's name is always different then the previous one, but if the image's name is same as the old one it not refreshing the image, its still showing the old image.here is my code:</p> <pre><code> var WishId = ""; var ImagePath = $('[id$=hdnImgPath]').val(); var DefaultImagePath = $('[id$=hdnDefaultImagePath]').val(); $("[id$=fpFiles]").uploadify({ 'swf': 'Swf/uploadify.swf', 'uploader': 'Resources/Handlers/UploadProfilePic.ashx', 'progressData': 'speed', 'cancelImg': 'Images/Grid_ActionDelete.gif', 'fileSizeLimit': '1MB', 'fileTypeExts': '*.gif; *.jpg; *.png', 'auto': true, 'multi': false, 'buttonText': 'Select', 'onSelect': function () { WishId = $('[id$=hdnWishId]').val(); $('#lnkUpload' + WishId).show(250); }, 'onUploadStart': function (file) { $("[id$=fpFiles]").uploadify('settings', 'formData', { 'WishID': "'" + WishId + "'" }); }, 'onUploadSuccess': function (file, data, response) { data = data.replace('"', '').replace('"', ''); if (data != '') { alert(data); $('[id$=imgUsersProfilePic]').attr('src', ImagePath + data); // $('#hdnImageName' + WishId).val(data); } else { $('#img' + WishId).attr('src', DefaultImagePath + 'defaultProfile.png'); } } }); </code></pre> <p>Please let me know what i have to do to display the latest image without post back, one thing more when i refresh my page its displaying the latest image.let me know where am i wrong. </p> <p><strong>Update:</strong> i know this image is coming from cache but i cannot delete the cache, if i it will delete users session too. so i need some alternate... </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload