如何使用asp.net上传多个图像并保存在数据库中? [英] how to upload multiple image and save in database using asp.net?
本文介绍了如何使用asp.net上传多个图像并保存在数据库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用单张图片上传并保存在数据库中。
我的代码 - :
I am using single image upload and save in data base.
My code-:
protected void btnUploadImage_Click(object sender, EventArgs e)
{
string filepath = null;
if (fileUploadImage.HasFile)
{
filepath = Path.GetFileName(fileUploadImage.PostedFile.FileName);
string fileFullpath = Server.MapPath("../../Content/ProductImage/") + filepath;
fileUploadImage.SaveAs(fileFullpath);
}
}
推荐答案
尝试此链接进行多次上传:
在ASP中使用进度条实现多个文件上传.NET [ ^ ]
使用Flash和ASP.NET使用进度条进行多文件上传 [ ^ ]
[ ^ ]
保存在数据库中你必须将图像转换为字节代码,数据类型应该是blob。
Try this link for multiple upload:
Implementing multiple file upload with progress bars within ASP.NET[^]
Multiple File Upload With Progress Bar Using Flash and ASP.NET[^]
[^]
To save in the database you have to convert the image to byte code and datatype should be blob.
这篇关于如何使用asp.net上传多个图像并保存在数据库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文