How to send doc file to database in asp.net
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.
精彩评论