亲测可以上传 300M的大文件,如果想上传更大的文件 请按照此链接提示做配置修改即可http://www.cnblogs.com/duanweishi/p/5408395.htmlPS:wcf项目没有拆分开,实际项目中 可以将wcf部分拆分成单独项目
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.IO;namespace WcfService1{ public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { FileData file = new FileData(); file.filename = FileUpload1.FileName; file.data = FileUpload1.PostedFile.InputStream; GetDataService c = new GetDataService(); c.UploadFile(file); Response.Write("文件传输成功!"); } }}
评论