img refreshing

img refreshing

Hi there,

I use code to upload image to server through ajax POST, following the image upload I update an image on page with the following code -

var img = new Image();
var d = new Date();

var fName = "/myfolder/" + $('#File')[0].files['0'].name + "?" + d.getTime();

$(img).load(function () {
$(this).appendTo("#imgDIV");
}).attr("src", fName);

The problem is after loading the image and setting the src attribute it shows only part of the image.





Any idea how to overcome this issue ?

Regards,