Ajax下传图片,怎么获取到下传图片的大小
Ajax上传图片,如何获取到上传图片的大小?
------解决方案--------------------
file.ContentLength
------解决方案--------------------
file.ContentLength
参考:HttpPostedFile 属性
if (context.Request.Files.Count > 0)
{
HttpPostedFile file = context.Request.Files[0];
string msg = "";
string error = "";
string path = context.Request["imgfile"];
string 获取到的文件大小(或者大于1M)//这里怎么写?
//以下略
------解决方案--------------------
file.ContentLength
------解决方案--------------------
file.ContentLength
参考:HttpPostedFile 属性