jQuery MiniUI 开发教程 表单控件 FileUpload:文件上传控件(二十)
FileUpload:文件上传控件
参考示例:FileUpload:文件上传控件
创建FileUpload
<inputid="fileupload1"class="mini-fileupload"name="Fdata"limitType="*.txt"
flashUrl="swfupload/swfupload.swf"
uploadUrl="upload.aspx"
onuploadsuccess="onUploadSuccess"/>
服务端处理
//获得程序路径
stringtempFile=Request.PhysicalApplicationPath;
//找到目标文件对象
HttpPostedFileuploadFile=Request.Files["Fdata"];
//如果有文件,则保存到一个地址
if(uploadFile.ContentLength>0)
{
uploadFile.SaveAs(string.Format("{0}{1}{2}",tempFile,"demo\\fileUpload\\upload\\",uploadFile.FileName));
}
Response.Write(uploadFile.FileName+"("+DateTime.Now+")");//可以返回一个JSON字符串,在客户端做更多处理
相关推荐
javamagicsun 2019-11-10
shumark 2014-07-07
RoyKings 2015-10-31
Sweetdream 2013-02-24
牧场SZShepherd 2012-03-20
南鹏飞技术 2016-06-11
ApachePHPMySQL 2012-02-15
dinux 2016-01-19
Andrewtao00 2011-10-23
shangsoft 2011-10-22
ISEESTARS 2011-09-07
ziyifengfei 2015-07-28
ErixHao 2011-03-30
jacky的部落 2011-03-29
zrtlin 2014-07-24
jackyzhuyuanlu 2014-07-07