I am trying to uplaod images to folder an then trying to show them as soon as they upload an I am able to display the image and not able to display it's URL simultaneously.
But inividually I am able to display one another.
Any help will be greatly appreciated
Thanks in advance
Here is my java script code:
<script type="text/javascript">
$(window).load(
function () {
$("#Inputfile").fileUpload({
'uploader': 'scripts/uploader.swf',
'cancelImg': 'images/cancel.png',
'buttonText': 'Browse Files',
'script': 'UploadVB.ashx',
'folder': 'uploads',
'fileDesc': 'Image Files',
'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'queueSizeLimit': 3,
'simUploadLimit': 2,
'sizeLimit' : 4000000,
'multi': true,
'auto': false,
'onQueueFull' : function (event,queueSizeLimit) {
alert("I'm stuffed, please don't put anymore files in me!");
return false;
},
'onComplete': fun开发者_开发百科ction (event, queueID, fileObj, response, data) {
$("#showimage").append("<img src='" + response + "' height='500px' width='500px' />");
$("#showimage").html(document.write('http://localhost:XXXX' + fileObj.filePath));
},
'onError' : function (event,ID,fileObj,errorObj) {
alert(errorObj.type + ' Error: ' + errorObj.info);
}
});
}
);
.html() is replacing the contents of $("#showimage")
with the html, which is wiping out the image. Try including your image tag in html:
$("#showimage").html('<img src="' + response + '" height="500" width="500" /><br />http://localhost:XXXX' + fileObj.filePath);
精彩评论