Uploadify的onComplete使用asp.net来显示影像和图像URL [英] Uploadify OnComplete to display Image and Image URL using asp.net

查看:153
本文介绍了Uploadify的onComplete使用asp.net来显示影像和图像URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想uplaod图像文件夹的,然后试图告诉他们,只要他们上传我能够显示图像,而不是能够显示它的URL同时进行。

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.

但inividually我能够显示彼此。

But inividually I am able to display one another.

任何帮助将大大AP preciated

Any help will be greatly appreciated

在此先感谢

下面是我的Java脚本code:

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': function (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()是替换 $的内容(#showimage)与HTML,这是歼灭形象。尝试包括HTML图像标记:

.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);

这篇关于Uploadify的onComplete使用asp.net来显示影像和图像URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆