1

How I can store large files (in 1GB or more) in SQL Server FileTables using Entity Framework in asp MVC.

I'm getting file from client side in HttpPostFileBase object.

Guide me what is best way for achieve this requirement.

mshoaiblibra
  • 390
  • 4
  • 15
  • Have you tried anything? – artm Oct 21 '14 at 06:26
  • Yeah. "do my work for me please" is not a question, it is whining. THAT SAID - I would be careful. I would avoid EF here for these tables. SQL can update parts of a file and 1gb and more means a LOT of memory in ONE array - and with EF there is no way around this memory use. Without EF you can optimize memory and for example stream the content. This is way outside the use case of an ORM. – TomTom Oct 21 '14 at 06:33
  • Thanks for reply. For artm: I tried 2 ways, 1st is http://www.eidias.com/Blog/2013/12/4/using-sql-filetable-in-entity-framework. it is not working large files. but working fine for less then 50 MB. Another way is using File.SaveAs() function simply paste file on required location. but problem is that I have one Mapping table I want to insert this new stream_id in mapping table. but if I used TransactionScope it's showing "the underlying provider failed on open" error. :( ... Otherwise its working fine. – mshoaiblibra Oct 21 '14 at 06:41

0 Answers0