如何将doc文件发送到asp.net中的数据库

问题描述:

我想发送(INSERT) doc文件,例如恢复到我的数据库的表格中。在asp.net 3.5中执行此操作需要什么代码?如何将doc文件发送到asp.net中的数据库

将发布的文件转换为字节流。

byte[] myByte = new byte[fupUpload.PostedFile.ContentLength]; 
Stream imgStream = fupUpload.PostedFile.InputStream; 
imgStream.Read(myByte, 0, fupUpload.PostedFile.ContentLength); 

然后使用ADO.NET模型中myByte流保存到数据库,您正在使用的应用程序。

+0

Thanx for the answer – shalini 2011-05-04 10:05:59