How to save multiple files to database rather than disk

849 views Asked by At

I tried to apply the method on this page, but this sample save the files to disk instead of Database. So, could you please inform me what changes should be made on the sample method or is there any sample using this Kendo Upload to save multiple files to database?

1

There are 1 answers

0
Yogi On BEST ANSWER

The following method declaration -

private IEnumerable<string> GetFileInfo(IEnumerable<HttpPostedFileBase> files)

which receives the uploaded files have IEnumerable<HttpPostedFileBase> as parameter. It is collection of all the uploaded files. Each file exposes a property InputStream. For more information visit this msdn page

So now that you have the file content in form of stream, convert this stream into byte[] and save this to database. Some suggestion are posted here.