jquery添加js文件上传|怎么样通过jQuery Ajax实现上传文件

|

『壹』 jquery.fileUpload.js文件上传问题

了解,fileuploader方法需要先初始化,然后才能触发上传,并不需要你手动触发change事件

你只版需

html

<form>file:<inputtype="file"id="file"name="file"></form>

js

$('#file').on('change',function(){//这里可权以做校验,返回false就不会触发下面的上传插件,否则就会触发上传if(!this.value||this.value.indexOf('.jpg')==-1){returnfalse;}});//初始化上传插件$('#file').fileupload({autoUpload:true,//这里为true,则选中文件后就会自动上传url:'',done:$.noop,fail:$.noop});

『贰』 jquery上传文件是怎么实现的

本篇文章是对Jquery中的LigerUI实现文件上传的方法,进行了分析介绍,需要的朋友可以参考下 一、在Head中加入<script src="../lib/js/ajaxfileupload.js" type="text/javascript"></script><script src="../lib/js/ligerui.expand.js" type="text/javascript"></script>二、Html中的Div代码复制代码 代码如下:<div id="AppendBill_Div" style="display:none;"> <%– 上传 – 单 –%><table style="height:100%;width:100%"><tr style="height:40px"><td style="width:20%">图标:</td><td><input type="file" style="width:200px" id="fileupload" name="fileupload"/></td></tr></table></div> 三、Js中-写的是关键部分,会LigerUI的朋友-你懂得1、grid中添加项【存地址字段】{ display: "扫描件", name: "AppendBillPath", width: 120, type: "text", align: "left" }2、Form可添加项【存地址和弹出选择框】{ name: "AppendBillPath1", type: "hidden" }, // –上传-【5】–{ display: "扫描件", name: "AppendBillPath", comboboxName: "AppendBillPath2", newline: true, labelWidth: 100, width: 150, space: 30, type: "select", options: {}} // –上传-【6】–$.ligerui.get("AppendBillPath2").set('onBeforeOpen', f_selectAppendBillPath_1) // 【扫描件】 // –上传-【7】–3、事件// #region ======================================= 【上传扫描件窗口】 // –上传-【8】–复制代码 代码如下:var AppendBillPathDetail = null;function f_selectAppendBillPath_1() {var imageurl = $("#AppendBill").val();var AppendBill_Id = $("#AppendBill").val(); // 单号if (imageurl.length == 0) {LG.showError("您没有输入单号,请输入随单号!");return;}if (AppendBillPathDetail) {AppendBillPathDetail.show();}else {AppendBillPathDetail = $.ligerDialog.open({target: $("#AppendBill_Div"), title: '添加图标',width: 360, height: 170, top: 170, left: 280, // 弹出窗口大小buttons: [{ text: '上传', onclick: function () { AppendBillPath_save(); } },{ text: '取消', onclick: function () { AppendBillPathDetail.hide(); } }]});}}function AppendBillPath_save(){var imgurl = $("#fileupload").val();// var filehelpcode = $("#filehelpcode").val();var extend = imgurl.substring(imgurl.lastIndexOf("."), imgurl.length);extend = extend.toLowerCase();if (extend == ".jpg" || extend == ".jpeg" || extend == ".png" || extend == ".gif" || extend == ".bmp"){}else{LG.showError("请上传jpg,jpep,png,gif,bmp格式的图片文件");return;}var imageurl = $("#AppendBill").val(); // extendalert(imageurl);$.ajaxFileUpload({url: "../handle/ImageUpload.aspx?imageurl=" + imageurl, // –上传-【9】– aspx文件secureuri: false,fileElementId: "fileupload", //Input file iddataType: "text",success: function (data, status){// —————– // 保存路径// $("#AppendBillPath2").val(Data);LG.tip(data);f_reload();},error: function (data, status, e) {LG.showError(data);}});}// #endregion 四、后台cs,写一句关键的,可以返回参数,前台提示string url = Server.MapPath("/Image/" + gfilename + filenameext); // 执行上传操作

『叁』 js及jquery实现动态的文件上传操作按钮的添加和删除

本文为大家介绍下使用js及jquery实现动态的文件上传操作按钮的添加和删除,具体示例如下,希望对大家有所帮助javascript实现 代码如下:<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htmlxmlns="http://www.w3.org/1999/xhtml"> <head> <metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/> <title>jquery文件上传</title> <scripttype="text/javascript"src="jquery-1.7.2.js"></script> <scripttype="text/javascript"> varaddMore=function(){ vardiv=document.getElementById("div2"); varbr=document.createElement("br"); varinput=document.createElement("input"); varbutton=document.createElement("input"); input.setAttribute("type","file"); button.setAttribute("type","button"); button.setAttribute("value","Remove"); button.onclick=function(){ div.removeChild(br); div.removeChild(input); div.removeChild(button); } div.appendChild(br); div.appendChild(input); div.appendChild(button); } //节点的移动 //$(function(){ //}); </script> </head> <body> <divid="div1"> <inputtype="file"id="upload"/> <inputtype="button"id="btn"value="more"onclick="addMore();"/> </div> <divid="div2"></div> </body> </html> jquery实现 代码如下:<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htmlxmlns="http://www.w3.org/1999/xhtml"> <head> <metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/> <title>jquery文件上传</title> <title>jquery1</title> <scripttype="text/javascript"src="jquery-1.7.2.js"></script> <scripttype="text/javascript"> /**varaddMore=function(){ vardiv=document.getElementById("div2"); varbr=document.createElement("br"); varinput=document.createElement("input"); varbutton=document.createElement("input"); input.setAttribute("type","file"); button.setAttribute("type","button"); button.setAttribute("value","Remove"); button.onclick=function(){ div.removeChild(br); div.removeChild(input); div.removeChild(button); } div.appendChild(br); div.appendChild(input); div.appendChild(button); }**/ //jquery实现文件上传的按钮添加和删除 $(function(){ $("input[type=button]").click(function(){ varbr=$("<br>"); varinput=$("<inputtype='file'/>"); varbutton=$("<inputtype='button'value='Remove'/>"); $("#div1").append(br).append(input).append(button); button.click(function(){ br.remove(); input.remove(); button.remove(); }); }); }); </script> </head> <body> <divid="div1"> <inputtype="file"id="upload"/> <inputtype="button"id="btn"value="more"onclick="addMore();"/> </div> <divid="div2"></div> </body> </html>

『肆』 怎么样通过jQuery Ajax实现上传文件

Query Ajax在web应用开发中很常用,它主要包括有ajax,get,post,load,getscript等等这几种常用无刷新操作方法,接下来通过本文给大家介绍jquery ajax 上传文件处理方式。FormData对象XMLHttpRequest Level 2添加了一个新的接口FormData.利用FormData对象,我们可以通过JavaScript用一些键值对来模拟一系列表单控件,我们还可以使用XMLHttpRequest的send()方法来异步的提交这个”表单”.比起普通的ajax,使用FormData的最大优点就是我们可以异步上传一个二进制文件.所有主流浏览器的较新版本都已经支持这个对象了,比如Chrome 7+、Firefox 4+、IE 10+、Opera 12+、Safari 5+。之前都是用原生js的XMLHttpRequest写的请求XMLHttpRequest方式xhr.open("POST", uri, true);xhr.onreadystatechange = function() {if (xhr.readyState == 4 && xhr.status == 200) {// Handle response.alert(xhr.responseText); // handle response.}};fd.append('myFile', file);// Initiate a multipart/form-data uploadxhr.send(fd);其实jquery的ajax也可以支持到的,关键是设置:processData 和 contentType 。ajax方式var formData = new FormData();var name = $("input").val();formData.append("file",$("#upload")[0].files[0]);formData.append("name",name);$.ajax({url : Url,type : 'POST',data : formData,// 告诉jQuery不要去处理发送的数据processData : false,// 告诉jQuery不要去设置Content-Type请求头contentType : false,beforeSend:function(){console.log("正在进行,请稍候");},success : function(responseStr) {if(responseStr.status===0){console.log("成功"+responseStr);}else{console.log("失败");}},error : function(responseStr) {console.log("error");}});

『伍』 jQuery实现文件上传。

/*jQuery实现文件上传,参考例子如下:packagecom.kinth.hddpt.file.action;importjava.io.File;importjava.io.FileNotFoundException;importjava.io.FileOutputStream;importjava.io.IOException;importjava.io.InputStream;importjava.io.OutputStream;importjava.util.ArrayList;importjava.util.Calendar;importjava.util.Enumeration;importjava.util.Hashtable;importjava.util.List;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importnet.sf.json.JSONArray;importorg.apache.commons.logging.Log;importorg.apache.commons.logging.LogFactory;importorg.apache.struts.action.ActionForm;importorg.apache.struts.action.ActionForward;importorg.apache.struts.action.ActionMapping;importorg.apache.struts.upload.FormFile;importorg.hibernate.criterion.MatchMode;importorg.hibernate.criterion.Order;importorg.hibernate.criterion.Restrictions;importcom.gdcn.bpaf.common.base.search.MyCriteria;importcom.gdcn.bpaf.common.base.search.MyCriteriaFactory;importcom.gdcn.bpaf.common.base.service.BaseService;importcom.gdcn.bpaf.common.helper.PagerList;importcom.gdcn.bpaf.common.helper.WebHelper;importcom.gdcn.bpaf.common.taglib.SplitPage;importcom.gdcn.bpaf.security.model.LogonVO;importcom.gdcn.components.appauth.common.helper.DictionaryHelper;importcom.kinth.common.base.action.BaseAction;importcom.kinth.hddpt.file.action.form.FileCatalogForm;importcom.kinth.hddpt.file.model.FileCatalog;importcom.kinth.hddpt.file.service.FileCatalogService;importcom.kinth.hddpt.file.util.MyZTreeNode;/***<p>*description:“文件上传的Struts层请求处理类”*</p>*@date:2013-1-14*/<FileCatalog>{@SuppressWarnings("unused")privatestaticLoglog=LogFactory.getLog(FileCatalogAction.class);//日志记录;//删除记录的同时删除相应文件publicActionForwardfileDelete(ActionMappingmapping,ActionFormform,HttpServletRequestrequest,HttpServletResponseresponse)throwsException{String[]id=request.getParameterValues("resourceId");if(id!=null&&id[0].contains(",")){id=id[0].split(",");}String[]fileUrls=newString[id.length];for(intj=0;j<id.length;j++){fileUrls[j]=fileCatalogService.findObject(id[j]).getFileUrl();if(!isEmpty(fileUrls[j])){//如果该文件夹不存在则创建一个uptext文件夹Filefileup=newFile(fileUrls[j]);if(fileup.exists()||fileup!=null){fileup.delete();}}fileCatalogService.deleteObject(id[j]);}setAllActionInfos(request);returnlist(mapping,form,request,response);}@OverridepublicActionForwardsave(ActionMappingmapping,ActionFormform,HttpServletRequestrequest,HttpServletResponseresponse)throwsException{Stringid=request.getParameter("resourceId");BooleanfileFlag=Boolean.valueOf(request.getParameter("fileFlag"));if(fileFlag!=null&&fileFlag==true){returnsuper.save(mapping,form,request,response);}else{StringfileUrl=this.fileUpload(form,request,id,fileFlag);response.setContentType("text/html");response.setCharacterEncoding("GBK");response.setHeader("Charset","GBK");response.setHeader("Cache-Control","no-cache");response.getWriter().write(fileUrl);response.getWriter().flush();}returnnull;}@SuppressWarnings("unchecked")publicStringfileUpload(ActionFormform,HttpServletRequestrequest,Stringid,BooleanfileFlag)throwsFileNotFoundException,IOException{request.setCharacterEncoding("GBK");StringbasePath=getServlet().getServletConfig().getServletContext().getRealPath("")+"/";StringfilePath="uploads/";//获取项目根路径;/*注释部分对应jqueryuploaploadify插件的后台代码,只是还存在编码问题,默认为utf-8StringsavePath=getServlet().getServletConfig().getServletContext().getRealPath("");//获取项目根路径savePath=savePath+"\uploads\";//读取上传来的文件信息Hashtable<String,FormFile>fileHashtable=form.getMultipartRequestHandler().getFileElements();Enumeration<String>enumeration=fileHashtable.keys();enumeration.hasMoreElements();Stringkey=(String)enumeration.nextElement();FormFileformFile=(FormFile)fileHashtable.get(key);Stringfilename=formFile.getFileName().trim();//文件名filename=newEncodeChange().changeCode(filename);Stringfiletype=filename.substring(filename.lastIndexOf(".")+1);//文件类型savePath=savePath+filetype+"\";System.out.println("path:"+savePath);StringrealPath=savePath+filename;//真实文件路径//如果该文件夹不存在则创建一个文件夹Filefileup=newFile(savePath);if(!fileup.exists()||fileup==null){fileup.mkdirs();}if(!filename.equals("")){//在这里上传文件InputStreamis=formFile.getInputStream();OutputStreamos=newFileOutputStream(realPath);intbytesRead=0;byte[]buffer=newbyte[8192];while((bytesRead=is.read(buffer,0,8192))!=-1){os.write(buffer,0,bytesRead);}os.close();is.close();//如果是修改操作,则删除原来的文件Stringid=request.getParameter("resourceId");if(!isEmpty(id)){FileCatalogfileCatalog=fileCatalogService.findObject(id);StringfileUrl=fileCatalog.getFileUrl();if(!isEmpty(fileUrl)){Filefiledel=newFile(fileUrl);if(filedel.exists()||filedel!=null){filedel.delete();}}request.setAttribute("entity",fileCatalog);}response.getWriter().print(realPath);//向页面端返回结果信息}*///读取上传来的文件信息Hashtable<String,FormFile>fileHashtable=form.getMultipartRequestHandler().getFileElements();Enumeration<String>enumeration=fileHashtable.keys();enumeration.hasMoreElements();Stringkey=(String)enumeration.nextElement();FormFileformFile=(FormFile)fileHashtable.get(key);Stringfilename=formFile.getFileName().trim();//文件名Stringfiletype=filename.substring(filename.lastIndexOf(".")+1);//文件类型IntegerfileSize=formFile.getFileSize();filePath+=Calendar.getInstance().get(Calendar.YEAR)+"/"+filetype+"/";StringrealPath=basePath+filePath+filename;//真实文件路径if(!filename.equals("")){//如果是修改操作,则删除原来的文件if(!isEmpty(id)){FileCatalogfileCatalog=fileCatalogService.findObject(id);StringfileUrl=fileCatalog.getFileUrl();if(!isEmpty(fileUrl)){fileUrl=basePath+fileUrl;Filefiledel=newFile(fileUrl);if(filedel.exists()||filedel!=null){filedel.delete();}}request.setAttribute("entity",fileCatalog);}//如果该文件夹不存在则创建一个文件夹Filefileup=newFile(basePath+filePath);if(!fileup.exists()||fileup==null){fileup.mkdirs();}//在这里上传文件InputStreamis=formFile.getInputStream();OutputStreamos=newFileOutputStream(realPath);intbytesRead=0;byte[]buffer=newbyte[8192];while((bytesRead=is.read(buffer,0,8192))!=-1){os.write(buffer,0,bytesRead);}os.close();is.close();}filePath+=filename;Stringresult="{"fileName":""+filename+"","fileType":""+filetype+"","fileSize":"+fileSize+","fileUrl":""+filePath+""}";returnresult;}(){returnfileCatalogService;}(){this.fileCatalogService=fileCatalogService;}}

『陆』 如何通过原生JS和jQuery版实现文件上传功能

代码:<?phpif (isset($_POST['upload'])) { var_mp($_FILES);move_uploaded_file($_FILES['upfile']['tmp_name'], 'up_tmp/'.time().'.dat');//header('location: test.php');exit;}?>

『柒』 jquery 多个 上传文件教程

jquery 实现多个上传文件教程:

首先创建解决方案,添加jquery的js和一些资源文件(如图片和进度条显示等):

jquery-1.3.2.min.jsjquery.uploadify.v2.1.0.jsjquery.uploadify.v2.1.0.min.jsswfobject.jsuploadify.css

1、页面的基本代码如下

这里用的是aspx页面(html也是也可的)

页面中引入的js和js函数如下:

<scriptsrc="js/jquery-1.3.2.min.js"type="text/javascript"></script><scriptsrc="js/jquery.uploadify.v2.1.0.js"type="text/javascript"></script><scriptsrc="js/jquery.uploadify.v2.1.0.min.js"type="text/javascript"></script><scriptsrc="js/swfobject.js"type="text/javascript"></script><linkhref="css/uploadify.css"rel="stylesheet"type="text/css"/></script>

js函数:

<scripttype="text/javascript">$(document).ready(function(){$("#uploadify").uploadify({'uploader':'image/uploadify.swf',//uploadify.swf文件的相对路径,该swf文件是一个带有文字BROWSE的按钮,点击后淡出打开文件对话框'script':'Handler1.ashx',//script:后台处理程序的相对路径'cancelImg':'image/cancel.png','buttenText':'请选择文件',//浏览按钮的文本,默认值:BROWSE。'sizeLimit':999999999,//文件大小显示'floder':'Uploader',//上传文件存放的目录'queueID':'fileQueue',//文件队列的ID,该ID与存放文件队列的div的ID一致'queueSizeLimit':120,//上传文件个数限制'progressData':'speed',//上传速度显示'auto':false,//是否自动上传'multi':true,//是否多文件上传//'onSelect':function(e,queueId,fileObj){//alert("唯一标识:"+queueId+""+//"文件名:"+fileObj.name+""+//"文件大小:"+fileObj.size+""+//"创建时间:"+fileObj.creationDate+""+//"最后修改时间:"+fileObj.modificationDate+""+//"文件类型:"+fileObj.type);//}'onQueueComplete':function(queueData){alert("文件上传成功!");return;}});});

页面中的控件代码:

<body><formid="form1"runat="server"><divid="fileQueue"></div><div><p><inputtype="file"name="uploadify"id="uploadify"/><inputid="Button1"type="button"value="上传"onclick="javascript:$('#uploadify').uploadifyUpload()"/><inputid="Button2"type="button"value="取消"onclick="javascript:$('#uploadify').uploadifyClearQueue()"/></p></div></form></body>

函数主要参数:

$(document).ready(function(){$('#fileInput1').fileUpload({'uploader':'uploader.swf',//不多讲了'script':'/AjaxByJQuery/file.do',//处理Action'cancelImg':'cancel.png','folder':'',//服务端默认保存路径'scriptData':{'methed':'uploadFile','arg1','value1'},//向后台传递参数,methed,arg1为参数名,uploadFile,value1为对应的参数值,服务端通过request["arg1"]'buttonText':'UpLoadFile',//按钮显示文字,不支持中文,解决方案见下//'buttonImg':'图片路径',//通过设置背景图片解决中文问题,就是把背景图做成按钮的样子'multi':'true',//多文件上传开关'fileExt':'*.xls;*.csv',//文件过滤器'fileDesc':'.xls',//文件过滤器详解见文档'onComplete':function(event,queueID,file,serverData,data){//serverData为服务器端返回的字符串值alert(serverData);}});});

后台一般处理文件:

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.IO;usingSystem.Net;usingSystem.Web;usingSystem.Web.Services;namespacefupload{///<summary>///Handler1的摘要说明///</summary>publicclassHandler1:IHttpHandler{publicvoidProcessRequest(HttpContextcontext){context.Response.ContentType="text/plain";HttpPostedFilefile=context.Request.Files["Filedata"];//对客户端文件的访问stringuploadPath=HttpContext.Current.Server.MapPath(@context.Request["folder"])+"\";//服务器端文件保存路径if(file!=null){if(!Directory.Exists(uploadPath)){Directory.CreateDirectory(uploadPath);//创建服务端文件夹}file.SaveAs(uploadPath+file.FileName);//保存文件context.Response.Write("上传成功");}else{context.Response.Write("0");}}publicboolIsReusable{get{returnfalse;}}}}

以上方式基本可以实现多文件的上传,大文件大小是在控制在10M以下/。

『捌』 弄了个jquery代码,把js文件上传到另一个服务器,请问我的html代码中该如何写调用代码啊

<scripttype="text/javascript"src="http://www.8u.cn/你的js文件路径就好了"></script>

『玖』 模拟JQUERY多文件上传效果

<!doctypehtml><htmllang="zh"><head><metacharset="utf-8"><title>HTML5AjaxUploader</title><scriptsrc="jquery-2.1.1.min.js"></script></head><body><p><inputtype="file"id="upfile"></p><p><inputtype="button"id="upJS"value="用原生JS上传"></p><p><inputtype="button"id="upJQuery"value="用jQuery上传"></p><script>/*原生JS版*/document.getElementById("upJS").onclick=function(){/*FormData是表单数据类*/varfd=newFormData();varajax=newXMLHttpRequest();fd.append("upload",1);/*把文件添加到表单里*/fd.append("upfile",document.getElementById("upfile").files[0]);ajax.open("post","test.php",true);ajax.onload=function(){console.log(ajax.responseText);};ajax.send(fd);}/*jQuery版*/$('#upJQuery').on('click',function(){varfd=newFormData();fd.append("upload",1);fd.append("upfile",$("#upfile").get(0).files[0]);$.ajax({url:"test.php",type:"POST",processData:false,contentType:false,data:fd,success:function(d){console.log(d);}});});</script></body></html><?phpif(isset($_POST['upload'])){var_mp($_FILES);move_uploaded_file($_FILES['upfile']['tmp_name'],'up_tmp/'.time().'.dat');//header('location:test.php');exit;}?>

『拾』 如何实现Jquery的LigerUI文件上传

一、在Head中加入 <script src="../lib/js/ajaxfileupload.js" type="text/javascript"></script> <script src="../lib/js/ligerui.expand.js" type="text/javascript"></script> 二、Html中的Div代码[html] view plain <div id="AppendBill_Div" style="display:none;"> <%– 上传 – 单 –%> <table style="height:100%;width:100%"> <tr style="height:40px"> <td style="width:20%"> 图标: </td> <td><input type="file" style="width:200px" id="fileupload" name="fileupload"/> </td> </tr> </table> </div> 三、Js中-写的是关键部分,会LigerUI的朋友-你懂得 1、grid中添加项【存地址字段】 { display: "扫描件", name: "AppendBillPath", width: 120, type: "text", align: "left" } 2、Form可添加项【存地址和弹出选择框】 { name: "AppendBillPath1", type: "hidden" }, // –上传-【5】– { display: "扫描件", name: "AppendBillPath", comboboxName: "AppendBillPath2", newline: true, labelWidth: 100, width: 150, space: 30, type: "select", options: {}} // –上传-【6】– $.ligerui.get("AppendBillPath2").set('onBeforeOpen', f_selectAppendBillPath_1) // 【扫描件】 // –上传-【7】– 3、事件 // #region ======================================= 【上传扫描件窗口】 // –上传-【8】–var AppendBillPathDetail = null; function f_selectAppendBillPath_1() { var imageurl = $("#AppendBill").val(); var AppendBill_Id = $("#AppendBill").val(); // 单号 if (imageurl.length == 0) { LG.showError("您没有输入单号,请输入随单号!"); return; }if (AppendBillPathDetail) { AppendBillPathDetail.show();} else {AppendBillPathDetail = $.ligerDialog.open({ target: $("#AppendBill_Div"), title: '添加图标', width: 360, height: 170, top: 170, left: 280, // 弹出窗口大小 buttons: [ { text: '上传', onclick: function () { AppendBillPath_save(); } }, { text: '取消', onclick: function () { AppendBillPathDetail.hide(); } } ] }); } }function AppendBillPath_save() {var imgurl = $("#fileupload").val(); // var filehelpcode = $("#filehelpcode").val();var extend = imgurl.substring(imgurl.lastIndexOf("."), imgurl.length); extend = extend.toLowerCase(); if (extend == ".jpg" || extend == ".jpeg" || extend == ".png" || extend == ".gif" || extend == ".bmp") { } else {LG.showError("请上传jpg,jpep,png,gif,bmp格式的图片文件");return; } var imageurl = $("#AppendBill").val(); // extend alert(imageurl);$.ajaxFileUpload({ url: "../handle/ImageUpload.aspx?imageurl=" + imageurl, // –上传-【9】– aspx文件 secureuri: false, fileElementId: "fileupload", //Input file iddataType: "text", success: function (data, status) {// —————– // 保存路径// $("#AppendBillPath2").val(Data); LG.tip(data); f_reload(); }, error: function (data, status, e) { LG.showError(data);} });}// #endregion四、后台cs,写一句关键的,可以返回参数,前台提示 string url = Server.MapPath("/Image/" + gfilename + filenameext); // 执行上传操作


赞 (0)