asp.net批量上传图片

luruion 2010-02-01 09:51:32
asp.net批量上传图片最好有源码,在线等!!!!!!!
...全文
682 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
Blue_Bubble 2011-11-01
  • 打赏
  • 举报
回复
有没有asp做的批量上传图片的啊?请高手解答。。。。
Adechen 2010-02-01
  • 打赏
  • 举报
回复
5楼的那个jqury控件还不错的
happy664618843 2010-02-01
  • 打赏
  • 举报
回复
网上搜下 这样代码很多
  • 打赏
  • 举报
回复
楼主可以参考Discuz!NT论坛的Silverlight方案

演示地址 http://nt.discuz.net

论坛源代码 http://www.comsenz.com/downloads/install/discuznt
wuyq11 2010-02-01
  • 打赏
  • 举报
回复
<script type="text/javascript">
function AddFile()
{
var strFile=" <input name=\"upload_file\" type='file' class='inputText' style='WIDTH:350px;'/> <br/>";
document.getElementById("td_uploadFile").insertAdjacentHTML("beforeEnd",strFile);
}
</script>
<input id="BtnAddFile" type="button" class="inputButton" value="增加附件" onclick="javascript:AddFile()" />

<td id="td_uploadFile" align="center">
<input id="upload_file" name="upload_Attachment" type="file" class="inputText"
style="width: 350px; display:none;" runat="server" />
</td>
HttpFileCollection Files = HttpContext.Current.Request.Files;
for (int i = 0; i < Files.Count; i++)
{

HttpPostedFile PostedFile = Files[i];
if (PostedFile.ContentLength > 0)
{}
}
http://topic.csdn.net/u/20091214/21/d9516597-0f08-4060-b830-6e82cac6d6de.html
chengjianhuadi 2010-02-01
  • 打赏
  • 举报
回复
跟其他的一样
就是循环了下。。。。。。
hyl200255 2010-02-01
  • 打赏
  • 举报
回复
学习了
whb147 2010-02-01
  • 打赏
  • 举报
回复
现在不都是用flash上传吗?
mengxj85 2010-02-01
  • 打赏
  • 举报
回复
HttpFileCollection files = HttpContext.Current.Request.Files;
if (files.Count <= 1)
{
Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>alert('请添加图片附件!'); hideWaitLayer();</script>");
}
else
{
try
{
for (int i = 0; i < files.Count; i++)
{
HttpPostedFile postedFile = files[i];
string filepath = System.IO.Path.GetFileName(postedFile.FileName);//获取文件名
if (filepath != "")
{
string fileName = filepath.Substring(filepath.LastIndexOf("\\") + 1);
string fileExtensions = fileName.Substring(fileName.LastIndexOf(".") + 1);//获取后缀名
//避免一次上传多个造成命名重复,特此再时间后再加一个序号,考虑到用户量不会很大,更大的并发操作在这里不考虑
string newFileName = DateTime.Now.ToString("yyyyMMddHHmmss") + i + "." + fileExtensions;
string serverPath = Server.MapPath("../Adjunct/ImagesNews/" + newFileName);
postedFile.SaveAs(serverPath);
ImagesNews.InsertImagesNews(txtName.Text == "" ? fileName : txtName.Text, txtDesc.Text, newFileName, "");//Session["userName"].ToString()
}
}
Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>alert('添加完成!');hideWaitLayer(); window.close(); </script>"); //window.opener.location.href=window.opener.location.href; window.reload();
}
catch (Exception ex)
{
throw ex;
Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>alert('添加失败!'); hideWaitLayer();</script>");
}
}
mengxj85 2010-02-01
  • 打赏
  • 举报
回复
绝代坏坏 2010-02-01
  • 打赏
  • 举报
回复
源码很长的。
tan124 2010-02-01
  • 打赏
  • 举报
回复
http://www.uploadify.com/
mengjun5200 2010-02-01
  • 打赏
  • 举报
回复
http://www.68design.net/Development/Aspnet/Basis-AspNet/24892-2.html

看看这个,有你想要的
weir55 2010-02-01
  • 打赏
  • 举报
回复
现在流行用FLASH做批量上传
http://www.cnblogs.com/zengxiangzhan/archive/2009/12/14/1623221.html
当然SL做的也有http://www.cnblogs.com/daizhj/archive/2009/04/08/1431090.html

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧