.net uploadify 传递参数 多文件上传

本文详细介绍了如何在微信页面后台中利用uploadify插件实现多张图片上传的功能,包括引用相关JS文件、配置uploadify插件、调用上传函数以及后台参数接收等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天临时安排去做微信页面,其中有一个后台,需要进行多张图片上传,于是使用uploadify插件,
使用前引用相关文件

<script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>
<link href="Js/jquery.uploadify-v2.1.4/uploadify.css"  type="text/css" />
<script type="text/javascript" src="Js/jquery.uploadify-v2.1.4/swfobject.js"></script>
<script  src="Js/jquery.uploadify-v2.1.4/jquery.uploadify.v2.1.4.min.js"></script>

进行uploadify配置

        $(document).ready(function() {
            $("#uploadify").uploadify({
                'uploader': 'Js/jquery.uploadify-v2.1.4/uploadify.swf',
                'script': 'UploadHandler.ashx',
                'buttonText': 'SELECT FILES',
                'cancelImg': 'Js/jquery.uploadify-v2.1.4/cancel.png',
                'folder': strDir,
                'auto': false,
                'multi': true,
                'sizeLimit': '4096000',
                'onSelect': function(e, queueId, fileObj) {
                    if (fileObj.size / 1024 > 4096) {
                        alert("你所选择的文件超过限制!");
                    }
                }

            });
        });

调用

<a href="javascript:checkTel();"> 上传图片</a>

其中checkTel函数为:

 function checkTel() {
    var tel = $('#txtTel').val();
    if (tel == "") { alert('请填写电话!'); return; }
    $('#uploadify').uploadifySettings('scriptData', 
                  { 'tel': document.getElementById('txtTel').value }); 
            jQuery('#uploadify').uploadifyUpload()
}

其中需要在后台进行参数接收

string tel = context.Request.Params["tel"];
string uploadPath = HttpContext.Current.Server.MapPath(@context.Request["folder"])

完成效果:
这里写图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值