有一个上传控件,
this.uploadFun.PostedFile.SaveAs(Server.MapPath(funPicPath));
可是这个图片却不显示,是差差,路径是绝对正确的,我在IE里直接打开这个图片也不显示,这是为什么呀????
this.uploadFun.PostedFile.SaveAs(Server.MapPath(funPicPath));
可是这个图片却不显示,是差差,路径是绝对正确的,我在IE里直接打开这个图片也不显示,这是为什么呀????
解决方案 »
- vs2010怎么不能使用AjaxControlToolkit里的控件?
- ajax 64位操作系统 和 32位操作系统区别
- Conversion failed when converting datetime from character string.
- asp.net 如何让menu子菜单也横向排列?(C#) 高手进啊
- 紧急求救,SQL Server中的表被drop table误删除了,能否恢复
- 如何从12345678中取得每位的数据?
- c#在Excel里面同时生成柱状图和折线图
- 在.net的多线程里可以调用页面吗
- javascript 动态加载DropDownList导致错误
- 两个组件同时使用DATABIND方法时为什么只有一个组件能显示数据?
- |M| VS2005修复了一下 但是出现新加页面多了很多的 using 不有什么区别
- 未将对象设置到实例,求救啊!
2.check一下你的连接访问path是否是预期的结果
3.遇到问题别那么猴急,有问题不会死人的
path是正确的.我就是打开服务器上这个文件图片却是差差.
up是文件的路径,fileName是文件名字
用个Image显示一下看看。。this.File1.PostedFile.SaveAs(Server.MapPath("up") + "\\" + fileName);
this.Image1.ImageUrl = "up/" + fileName;
this.uploadFun.PostedFile.SaveAs(Server.MapPath(funPicPath));funPicPath是什么?
private void uploading()
{
string strFillName = File1.PostedFile.FileName;
string strFileName = Path.GetFileName(strFillName);
string strExtName = Path.GetExtensio(strFileName).ToLower();
if(strExtName.Equals(".jpg") || strExtName.Equals(".gif"))
{
string strpath = Server.MapPath("../../upload");
File1.PostedFile.SaveAs(strpath + "\\" + strFileName);
}
else
{
MessageBox.Show(this,"文件扩展名不正确");
}
}
取的时候路径指定正确就好了,别心急,还是你的操作有失误,好好找找,要不不会出错的。
{
string shopInPicPath = this.lsbShopInPic.Items[n].ToString();
filename = shopInPicPath.Substring(shopInPicPath.LastIndexOf("\\"));
string shopInPic = "\\UpImages\\Amusement\\ShopInPicture"+filename ;
this.uploadfileShopInPic.PostedFile.SaveAs(Server.MapPath(shopInPic));
}
lsbInCount这是一个ListBox
这样写有问题吗?
IIS mime type加一下吧.