$(function () { var wait = $("<img src=\"\" alt=\"正在上传\"/>"); $("#File1").change(function () { $("#form1").ajaxSubmit({ url: ‘/Provider/HandlerUpOneFile.ashx?path=1‘, beforeSubmit: function () { }, success: function (data) { $("#File1").attr("src", data); // alert( $("#File1").attr("src")); alert(data); } }); }); });
<form id="form1" method="post" enctype="multipart/form-data" > <div class="easyui-panel" style="padding:10px;"> 选择文件 <input type="file" id="File1" name="File1" /> 注意此处 name 必须设置否则无法获取 <a class="easyui-linkbutton" data-options="iconCls:‘icon-ok‘" href="javascript:void(0)" onclick="LoadData()">上传文件</a> </div></form>
时间: 2024-10-13 11:44:14