我想用AjaxFileUpload将多个文件上传到SQL数据库。我有一种方法可以用来上传单个文件;与aspx页面:如何使用AjaxFileUpload将图像文件流式传输到SQL数据源?
而且与aspx.cs页:
protected void UploadFile(object sender, EventArgs e)
{
FileUpload FileUpload1 = file_Image;
// Read the file and convert it to Byte Array
string filePath = file_Image.PostedFile.FileName;
string filename = Path.GetFileName(filePath);
if (FileUpload1.HasFile && FileUpload1.PostedFile != null)
{
Stream fs = file_Image.PostedFile.InputStream;
BinaryReader br = new BinaryReader(fs);
Byte[] bytes = br.ReadBytes((Int32)fs.Length);}}
但是,我怎么能使用类似的东西AjaxFileUpload或者是它甚至有可能到流这样的图像数据来自Ajax控件?非常感谢您分享您的知识!
2013-03-08
Jacman
+0
感谢您的答复;我正在使用SQL Server 2008 R2(SQL Server Management Studio) –
2013-03-08 16:59:17
+0
我想这是一个复杂的问题;但是,有什么方法可以处理? –
2013-03-08 17:40:46
+0
你有什么困难?允许多个文件上传或保存到数据库的控件? –
2013-03-08 19:23:34