{"id":103,"date":"2016-09-25T13:51:36","date_gmt":"2016-09-25T13:51:36","guid":{"rendered":"http:\/\/gkokot.com\/?p=103"},"modified":"2017-02-05T18:41:03","modified_gmt":"2017-02-05T18:41:03","slug":"cannot-access-a-closed-file-fileupload-in-asp-net","status":"publish","type":"post","link":"https:\/\/gkokot.com\/?p=103","title":{"rendered":"Cannot access a closed file \u2013 FileUpload in ASP.NET"},"content":{"rendered":"<p>This was very interesting error,\u00a0I got during development of file upload control in ASP.NET.<\/p>\n<p>On my local system, every thing was just fine. but when\u00a0I deployed my application on development server, my control was able to upload only small size files.<\/p>\n<p>Whenever\u00a0I tried to upload large size file i got error \u201ccannot access a closed file\u201d.<\/p>\n<p>After going through MSDN\u00a0I found that there is one new element added in ASP.NET 2.0 known as httpRuntime.<\/p>\n<p>So\u00a0I just added this new Tag in my web.config and every thing was right.<\/p>\n<p>&nbsp;<\/p>\n<p><em>&lt;system.web&gt;<\/em><br \/>\n<em>&lt;httpRuntime\u00a0 maxRequestLength=&#8221;15360&#8243; requestLengthDiskThreshold=&#8221;15360&#8243;\/&gt;<\/em><br \/>\n<em>&lt;\/system.web&gt;<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This was very interesting error,\u00a0I got during development of file upload control in ASP.NET. On<a class=\"readmore btn btn-info\" href=\"https:\/\/gkokot.com\/?p=103\" rel=\"nofollow\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":70,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,3,5],"tags":[],"class_list":["post-103","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-asp-net","category-c","category-visual-studio"],"_links":{"self":[{"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/posts\/103"}],"collection":[{"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gkokot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=103"}],"version-history":[{"count":1,"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":104,"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions\/104"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/media\/70"}],"wp:attachment":[{"href":"https:\/\/gkokot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gkokot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gkokot.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}