ajax 上传execl 并返回结果

<form id = 'uploadForm'>
    <input type="file" name="upload" value="选择文件"  />
    <input type="button" class="btn-sub" value="导入设备列表" onclick="doUpload()"/>
</form>

<script>
    function doUpload() {
        var formData = new FormData($( "#uploadForm" )[0]);
        $.ajax({
            url: "<!--{$smarty.const.WEB_ROOT}-->wifiadmin/stores/import_ap_execl",
            type: 'POST',
            data: formData,
            async: false,
            cache: false,
            contentType: false,
            processData: false,
            success: function (returndata) {
                alert(returndata);
            },
            error: function (returndata) {
                alert(returndata);
            }
        });
    }
</script>

 

execl 由后端解析

posted @ 2015-08-26 16:04  望远近  阅读(271)  评论(0编辑  收藏  举报