NickName:Amit Ask DateTime:2011-04-29T03:27:22 How to Upload 100MB file? I am designing a File Server application in ASP.NET. I have to upload a file of size 100MB and then save it into SQL Server 2008 database in varbinary(max). Saving file in DB is must. I am using FileUpload control. Please suggest me how to handle such large file? UPDATE Any code example would be great help, any code sample?How to read file in chunks? Copyright Notice:Content Author:「Amit」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.Link to original article:https://stackoverflow.com/questions/5823896/how-to-upload-100mb-file Answers Ferruccio 2011-04-28T19:32:24 ASP.NET has a default limit of 4MB for file uploads. This article describes how to change that default and discusses some of the issues with uploading large files.", marcoaoteixeira 2011-04-28T19:31:40 Try this: Large file uploads in ASP.NET.\n\nLet me know if it helps.", Michael Levy 2011-04-28T19:47:35 Years ago (in ASP 1.1?), I used this control and it was great. \n\nSee\nhttp://krystalware.com/Products/SlickUpload/\n\nhttp://krystalware.com/Products/SlickUpload/Documentation/concepts/uploading-sql-server.aspx", Nik 2011-04-28T19:29:17 Because you are using SQL Server 2008 with its 2gb maximum for varbinary columns, you should be fine. Any regular upload script will probably work. When you get into uploads of that size though, underlying HTTP or TCP/IP connections can become a problem, but there really isn't anything you can do about that.", Brian MacKay 2011-04-28T19:37:08 You can change the default limit (4mb) for a directory and its children by dropping a special web.config into that directory. That way you don't have to make your whole site allow huge uploads (doing so would open you up to a certain kinds of attacks).\n\nHere's an example from a production app. This one is set for 200mb:\n\n<?xml version=\"1.0\"?>\n<!-- Nested this web.config here to allow for huge uploads (up to 200mb) -->\n\n<configuration>\n <system.web>\n <httpRuntime maxRequestLength=\"200000\"/>\n </system.web>\n</configuration>\n\n\nNesting web.configs does not have any negative side-effects -- your existing web.config settings will still work site-wide, and from this directory on down, these httpRuntime settings will be inherited.\n\nOn the page that handles the upload, make sure you have a higher than normal ScriptTimeout. This is measured in seconds:\n\nServer.ScriptTimeout = 1200;\n\n\nI like setting this on the page rather than web.config because it isolates the increased timeout down to just this one page. \n\nOn the SQL side, varbinary columns can be up to 2 gigs so you're good to go there.\n\nUpdate: I've used this approach with 50+ meg files, but it's possible that at the 100 meg point the standard methods might break down. There are a lot of third party controls available that could take over from there, but I would probably look hard at Telerik's RadUpload since they're a quality name and it looks very polished: RadUpload\n\nAs for your update regarding reading the file in chunks, if you really want to write that yourself, Bobby D pointed out this article: Uploading Large Files Using an HttpModule",