开发者

How to send doc file to database in asp.net

开发者 https://www.devze.com 2023-03-02 22:32 出处:网络
I want to send (INSERT) a doc file, e.g resume into a t开发者_如何学JAVAable of my database. What is the code required to perform this in asp.net 3.5?Convert the posted file into a Byte Stream.

I want to send (INSERT) a doc file, e.g resume into a t开发者_如何学JAVAable of my database. What is the code required to perform this in asp.net 3.5?


Convert the posted file into a Byte Stream.

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

Then save the myByte stream into the DB using the ADO.NET Model, that you are using in your application.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号