<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Getting Started</title><link>http://forums.asp.net/15.aspx</link><description>The perfect forum for ASP.NET novices. No question too simple! &lt;A href="http://aspadvice.com/SignUp/list.aspx?l=21&amp;amp;c=17" target=_blank&gt;Email List&lt;/A&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: FileUploader, Problem to detect size of a file thats bigger then the set maxRequestLength in the web.cofig..</title><link>http://forums.asp.net/thread/3276248.aspx</link><pubDate>Mon, 06 Jul 2009 08:00:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3276248</guid><dc:creator>Bober Song - MSFT</dc:creator><author>Bober Song - MSFT</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3276248.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3276248</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi &lt;strong&gt;Inx&lt;/strong&gt;,&lt;/p&gt;
&lt;p&gt;From your description, I think you want to upload the big file to the server, and you want to configure the big file length.&lt;/p&gt;
&lt;p&gt;The forum has more threads which are related to how to upload the big file to server via ASP.NET. Please check the following links:&lt;/p&gt;
&lt;p&gt;Upload files, writing permission, resize the length of the uploading file&lt;br /&gt;&lt;a href="http://forums.asp.net/p/1430985/3212574.aspx#3212574"&gt;http://forums.asp.net/p/1430985/3212574.aspx#3212574&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Giving ASP.NET Proper Permissions to Upload Files&lt;br /&gt;&lt;a href="http://forums.asp.net/p/1408159/3077586.aspx#3077586"&gt;http://forums.asp.net/p/1408159/3077586.aspx#3077586&lt;/a&gt;&lt;br /&gt;&lt;a href="http://forums.asp.net/p/1422238/3168752.aspx#3168752"&gt;http://forums.asp.net/p/1422238/3168752.aspx#3168752&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I hope it is helpful to you.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: FileUploader, Problem to detect size of a file thats bigger then the set maxRequestLength in the web.cofig..</title><link>http://forums.asp.net/thread/3274776.aspx</link><pubDate>Sat, 04 Jul 2009 15:37:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274776</guid><dc:creator>rickj1</dc:creator><author>rickj1</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274776.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274776</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;try this example from Stphen Walther&amp;#39;s book asp.net unleashed 3.5&lt;/p&gt;
&lt;p&gt;you should be able to tweek this code to fit your needs&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;const string conString = @&amp;quot;Server=.\SQLExpress;Integrated Security=True;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AttachDbFileName=|DataDirectory|FilesDB.mdf;User Instance=True&amp;quot;;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void btnAdd_Click(Object s, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (upFile.HasFile)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (CheckFileType(upFile.FileName))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddFile(upFile.FileName, upFile.FileContent);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rptFiles.DataBind();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool CheckFileType(string fileName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Path.GetExtension(fileName).ToLower() == &amp;quot;.doc&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void AddFile(string fileName, Stream upload)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlConnection con = new SqlConnection(conString);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlCommand cmd = new SqlCommand(&amp;quot;INSERT Files (FileName) Values (@FileName);&amp;quot; +&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;SELECT @Identity = SCOPE_IDENTITY()&amp;quot;, con);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Parameters.AddWithValue(&amp;quot;@FileName&amp;quot;, fileName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlParameter idParm = cmd.Parameters.Add(&amp;quot;@Identity&amp;quot;, SqlDbType.Int);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; idParm.Direction = ParameterDirection.Output;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (con)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; con.Open();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.ExecuteNonQuery();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int newFileId = (int)idParm.Value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StoreFile(newFileId, upload, con);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void StoreFile(int fileId, Stream upload, SqlConnection connection)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int bufferLen = 8040;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BinaryReader br = new BinaryReader(upload);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] chunk = br.ReadBytes(bufferLen);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlCommand cmd = new SqlCommand(&amp;quot;UPDATE Files SET &lt;a href="mailto:FileBytes=@Buffer"&gt;FileBytes=@Buffer&lt;/a&gt; WHERE &lt;a href="mailto:Id=@FileId"&gt;Id=@FileId&lt;/a&gt;&amp;quot;, connection);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Parameters.AddWithValue(&amp;quot;@FileId&amp;quot;, fileId);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Parameters.Add(&amp;quot;@Buffer&amp;quot;, SqlDbType.VarBinary, bufferLen).Value = chunk;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.ExecuteNonQuery();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlCommand cmdAppend = new SqlCommand(&amp;quot;UPDATE Files SET FileBytes .WRITE(@Buffer, NULL, 0) WHERE &lt;a href="mailto:Id=@FileId"&gt;Id=@FileId&lt;/a&gt;&amp;quot;, connection);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmdAppend.Parameters.AddWithValue(&amp;quot;@FileId&amp;quot;, fileId);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmdAppend.Parameters.Add(&amp;quot;@Buffer&amp;quot;, SqlDbType.VarBinary, bufferLen);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chunk = br.ReadBytes(bufferLen);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (chunk.Length &amp;gt; 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmdAppend.Parameters[&amp;quot;@Buffer&amp;quot;].Value = chunk;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmdAppend.ExecuteNonQuery();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chunk = br.ReadBytes(bufferLen);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; br.Close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;</description></item><item><title>Re: FileUploader, Problem to detect size of a file thats bigger then the set maxRequestLength in the web.cofig..</title><link>http://forums.asp.net/thread/3274551.aspx</link><pubDate>Sat, 04 Jul 2009 10:32:17 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274551</guid><dc:creator>Inx</dc:creator><author>Inx</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274551.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274551</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;shahed.kazi:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;You need to increase the request length property in web.config file.&lt;/p&gt;&lt;pre&gt;&amp;lt;httpRuntime maxRequestLength=&amp;quot;&lt;b&gt;4096&lt;/b&gt;&amp;quot;  /&amp;gt; //increase this to a higher number.&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;Yeah I know..but the things is that the maximum maxRequestLength&lt;span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"&gt; is &lt;/span&gt;&lt;span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"&gt;2097151kb. (Which is some where around 2Gb) And even if I do know that if someone tries to upload a file thats over 2Gb directly to the page, he/she is kind of a morron...but still...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"&gt;If you whould try to do that the Buttons on_click event wont even fire...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"&gt;As I said..if the file you try to upload excedes the size thats set in the &lt;/span&gt;maxRequestLength the Button event wont fire...but I still need to let my suer know that the file they try to upload is to big...&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: FileUploader, Problem to detect size of a file thats bigger then the set maxRequestLength in the web.cofig..</title><link>http://forums.asp.net/thread/3274548.aspx</link><pubDate>Sat, 04 Jul 2009 10:28:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274548</guid><dc:creator>Inx</dc:creator><author>Inx</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274548.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274548</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;avicool08:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;HI&amp;nbsp;&lt;/p&gt;&lt;p&gt;YOU CAN try giving custom validator.... hope it helps.....&lt;/p&gt;&lt;p&gt;For coding please check the below link...&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.mikeborozdin.com/?tag=/file+uploading"&gt;http://www.mikeborozdin.com/?tag=/file+uploading&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;Doesnt this function actually requires the file to already be uploaded?...since its useing .PostedFile?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: FileUploader, Problem to detect size of a file thats bigger then the set maxRequestLength in the web.cofig..</title><link>http://forums.asp.net/thread/3274425.aspx</link><pubDate>Sat, 04 Jul 2009 07:45:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274425</guid><dc:creator>shahed.kazi</dc:creator><author>shahed.kazi</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274425.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274425</wfw:commentRss><description>&lt;p&gt;You need to increase the request length property in web.config file.&lt;/p&gt;&lt;pre&gt;&amp;lt;httpRuntime maxRequestLength=&amp;quot;&lt;b&gt;4096&lt;/b&gt;&amp;quot;  /&amp;gt; //increase this to a higher number.&lt;br /&gt;&lt;/pre&gt;</description></item><item><title>Re: FileUploader, Problem to detect size of a file thats bigger then the set maxRequestLength in the web.cofig..</title><link>http://forums.asp.net/thread/3274194.aspx</link><pubDate>Sat, 04 Jul 2009 04:02:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274194</guid><dc:creator>avicool08</dc:creator><author>avicool08</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274194.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274194</wfw:commentRss><description>&lt;p&gt;HI&amp;nbsp;&lt;/p&gt;&lt;p&gt;YOU CAN try giving custom validator.... hope it helps.....&lt;/p&gt;&lt;p&gt;For coding please check the below link...&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.mikeborozdin.com/?tag=/file+uploading"&gt;http://www.mikeborozdin.com/?tag=/file+uploading&lt;/a&gt;&lt;/p&gt;</description></item><item><title>FileUploader, Problem to detect size of a file thats bigger then the set maxRequestLength in the web.cofig..</title><link>http://forums.asp.net/thread/3274119.aspx</link><pubDate>Sat, 04 Jul 2009 00:34:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274119</guid><dc:creator>Inx</dc:creator><author>Inx</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274119.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274119</wfw:commentRss><description>&lt;p&gt;Hi!&lt;/p&gt;&lt;p&gt;Im currently in deep need of some help...You see I have this FileUploader that i then try to upload a file thats bigger then the set maxRequestLength, and I know that its not possible to upload it, but the problem is that I still want to detect how big the file is and if its bigger then my set maxRequestLength then I want it to return a error message to the user.&lt;/p&gt;&lt;p&gt;Its kind of tricky to explain so I will give you an example...but first of all here is some code and a full site that demonstrates the problem...&lt;/p&gt;&lt;p&gt;A more indepth analys of my problem is in the lines to the bottom of this post...&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Download an already created example here: &lt;a target="_blank" href="http://www.2shared.com/file/6550470/985d2ac5/FileUploadTestOver2Gb.html"&gt;http://www.2shared.com/file/6550470/985d2ac5/FileUploadTestOver2Gb.html&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The actuall aspx page:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="xhtml"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot;  CodeFile=&amp;quot;Default.aspx.cs&amp;quot; Inherits=&amp;quot;_Default&amp;quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;div&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;asp:FileUpload ID=&amp;quot;FileUpload1&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;asp:Button ID=&amp;quot;Button1&amp;quot; runat=&amp;quot;server&amp;quot; onclick=&amp;quot;Button1_Click&amp;quot; &lt;br /&gt;        Text=&amp;quot;Upload file&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;p&amp;gt;&lt;br /&gt;        &amp;lt;asp:Label ID=&amp;quot;Label1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;    &amp;lt;/p&amp;gt;&lt;br /&gt;    &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; The server-side code(C#)&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="c-sharp"&gt;using System;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Xml.Linq;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page &lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        //If the file is bigger then 50Mb do:&lt;br /&gt;        if (FileUpload1.FileBytes.Length &amp;gt;= 52428800)&lt;br /&gt;        {&lt;br /&gt;            Label1.Text = &amp;quot;The File is bigger then 50Mb, cant upload a file of that size&amp;quot;;&lt;br /&gt;        }&lt;br /&gt;        //If the file is bigger then 2Gb do:&lt;br /&gt;        else if (FileUpload1.FileBytes.Length &amp;gt;= 268435456)&lt;br /&gt;        {&lt;br /&gt;            Label1.Text = &amp;quot;The File is bigger then 2Gb, cant upload a file of that size&amp;quot;;&lt;br /&gt;        }&lt;br /&gt;        //If the file passed the validation,upload it..&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            FileUpload1.SaveAs(Request.PhysicalApplicationPath + &amp;quot;\\&amp;quot; + FileUpload1.FileName);&lt;br /&gt;            Label1.Text = &amp;quot;File successfully uploaded!&amp;quot;;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; and finally my web.config(Notice that I have added the following line &amp;lt;httpRuntime maxRequestLength=&amp;quot;2097152&amp;quot; executionTimeout=&amp;quot;360&amp;quot;/&amp;gt; after the &amp;lt;system.web&amp;gt; tag (2097152bytes = 2Gb))&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="xhtml"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;!-- &lt;br /&gt;    Note: As an alternative to hand editing this file you can use the &lt;br /&gt;    web admin tool to configure settings for your application. Use&lt;br /&gt;    the Website-&amp;gt;Asp.Net Configuration option in Visual Studio.&lt;br /&gt;    A full list of settings and comments can be found in &lt;br /&gt;    machine.config.comments usually located in &lt;br /&gt;    \Windows\Microsoft.Net\Framework\v2.x\Config &lt;br /&gt;--&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;	&amp;lt;configSections&amp;gt;&lt;br /&gt;		&amp;lt;sectionGroup name=&amp;quot;system.web.extensions&amp;quot; type=&amp;quot;System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;&amp;gt;&lt;br /&gt;			&amp;lt;sectionGroup name=&amp;quot;scripting&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;&amp;gt;&lt;br /&gt;				&amp;lt;section name=&amp;quot;scriptResourceHandler&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; allowDefinition=&amp;quot;MachineToApplication&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;sectionGroup name=&amp;quot;webServices&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;&amp;gt;&lt;br /&gt;					&amp;lt;section name=&amp;quot;jsonSerialization&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; allowDefinition=&amp;quot;Everywhere&amp;quot;/&amp;gt;&lt;br /&gt;					&amp;lt;section name=&amp;quot;profileService&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; allowDefinition=&amp;quot;MachineToApplication&amp;quot;/&amp;gt;&lt;br /&gt;					&amp;lt;section name=&amp;quot;authenticationService&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; allowDefinition=&amp;quot;MachineToApplication&amp;quot;/&amp;gt;&lt;br /&gt;					&amp;lt;section name=&amp;quot;roleService&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; allowDefinition=&amp;quot;MachineToApplication&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;/sectionGroup&amp;gt;&lt;br /&gt;			&amp;lt;/sectionGroup&amp;gt;&lt;br /&gt;		&amp;lt;/sectionGroup&amp;gt;&lt;br /&gt;	&amp;lt;/configSections&amp;gt;&lt;br /&gt;	&amp;lt;appSettings/&amp;gt;&lt;br /&gt;	&amp;lt;connectionStrings/&amp;gt;&lt;br /&gt;	&amp;lt;system.web&amp;gt;&lt;br /&gt;		&amp;lt;httpRuntime maxRequestLength=&amp;quot;2097152&amp;quot; executionTimeout=&amp;quot;360&amp;quot;/&amp;gt;&lt;br /&gt;		&amp;lt;!-- &lt;br /&gt;            Set compilation debug=&amp;quot;true&amp;quot; to insert debugging &lt;br /&gt;            symbols into the compiled page. Because this &lt;br /&gt;            affects performance, set this value to true only &lt;br /&gt;            during development.&lt;br /&gt;        --&amp;gt;&lt;br /&gt;		&amp;lt;compilation debug=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;			&amp;lt;assemblies&amp;gt;&lt;br /&gt;				&amp;lt;add assembly=&amp;quot;System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;add assembly=&amp;quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;add assembly=&amp;quot;System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;add assembly=&amp;quot;System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;/assemblies&amp;gt;&lt;br /&gt;		&amp;lt;/compilation&amp;gt;&lt;br /&gt;		&amp;lt;!--&lt;br /&gt;            The &amp;lt;authentication&amp;gt; section enables configuration &lt;br /&gt;            of the security authentication mode used by &lt;br /&gt;            ASP.NET to identify an incoming user. &lt;br /&gt;        --&amp;gt;&lt;br /&gt;		&amp;lt;authentication mode=&amp;quot;Windows&amp;quot;/&amp;gt;&lt;br /&gt;		&amp;lt;!--&lt;br /&gt;            The &amp;lt;customErrors&amp;gt; section enables configuration &lt;br /&gt;            of what to do if/when an unhandled error occurs &lt;br /&gt;            during the execution of a request. Specifically, &lt;br /&gt;            it enables developers to configure html error pages &lt;br /&gt;            to be displayed in place of a error stack trace.&lt;br /&gt;&lt;br /&gt;        &amp;lt;customErrors mode=&amp;quot;RemoteOnly&amp;quot; defaultRedirect=&amp;quot;GenericErrorPage.htm&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;error statusCode=&amp;quot;403&amp;quot; redirect=&amp;quot;NoAccess.htm&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;error statusCode=&amp;quot;404&amp;quot; redirect=&amp;quot;FileNotFound.htm&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/customErrors&amp;gt;&lt;br /&gt;        --&amp;gt;&lt;br /&gt;		&amp;lt;pages&amp;gt;&lt;br /&gt;			&amp;lt;controls&amp;gt;&lt;br /&gt;				&amp;lt;add tagPrefix=&amp;quot;asp&amp;quot; namespace=&amp;quot;System.Web.UI&amp;quot; assembly=&amp;quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;add tagPrefix=&amp;quot;asp&amp;quot; namespace=&amp;quot;System.Web.UI.WebControls&amp;quot; assembly=&amp;quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;/controls&amp;gt;&lt;br /&gt;		&amp;lt;/pages&amp;gt;&lt;br /&gt;		&amp;lt;httpHandlers&amp;gt;&lt;br /&gt;			&amp;lt;remove verb=&amp;quot;*&amp;quot; path=&amp;quot;*.asmx&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;add verb=&amp;quot;*&amp;quot; path=&amp;quot;*.asmx&amp;quot; validate=&amp;quot;false&amp;quot; type=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;add verb=&amp;quot;*&amp;quot; path=&amp;quot;*_AppService.axd&amp;quot; validate=&amp;quot;false&amp;quot; type=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;add verb=&amp;quot;GET,HEAD&amp;quot; path=&amp;quot;ScriptResource.axd&amp;quot; type=&amp;quot;System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; validate=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;		&amp;lt;/httpHandlers&amp;gt;&lt;br /&gt;		&amp;lt;httpModules&amp;gt;&lt;br /&gt;			&amp;lt;add name=&amp;quot;ScriptModule&amp;quot; type=&amp;quot;System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;&lt;br /&gt;		&amp;lt;/httpModules&amp;gt;&lt;br /&gt;	&amp;lt;/system.web&amp;gt;&lt;br /&gt;	&amp;lt;system.codedom&amp;gt;&lt;br /&gt;		&amp;lt;compilers&amp;gt;&lt;br /&gt;			&amp;lt;compiler language=&amp;quot;c#;cs;csharp&amp;quot; extension=&amp;quot;.cs&amp;quot; warningLevel=&amp;quot;4&amp;quot; type=&amp;quot;Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;quot;&amp;gt;&lt;br /&gt;				&amp;lt;providerOption name=&amp;quot;CompilerVersion&amp;quot; value=&amp;quot;v3.5&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;providerOption name=&amp;quot;WarnAsError&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;/compiler&amp;gt;&lt;br /&gt;			&amp;lt;compiler language=&amp;quot;vb;vbs;visualbasic;vbscript&amp;quot; extension=&amp;quot;.vb&amp;quot; warningLevel=&amp;quot;4&amp;quot; type=&amp;quot;Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;quot;&amp;gt;&lt;br /&gt;				&amp;lt;providerOption name=&amp;quot;CompilerVersion&amp;quot; value=&amp;quot;v3.5&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;providerOption name=&amp;quot;OptionInfer&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;providerOption name=&amp;quot;WarnAsError&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;/compiler&amp;gt;&lt;br /&gt;		&amp;lt;/compilers&amp;gt;&lt;br /&gt;	&amp;lt;/system.codedom&amp;gt;&lt;br /&gt;	&amp;lt;!-- &lt;br /&gt;        The system.webServer section is required for running ASP.NET AJAX under Internet&lt;br /&gt;        Information Services 7.0.  It is not necessary for previous version of IIS.&lt;br /&gt;    --&amp;gt;&lt;br /&gt;	&amp;lt;system.webServer&amp;gt;&lt;br /&gt;		&amp;lt;validation validateIntegratedModeConfiguration=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;		&amp;lt;modules&amp;gt;&lt;br /&gt;			&amp;lt;remove name=&amp;quot;ScriptModule&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;add name=&amp;quot;ScriptModule&amp;quot; preCondition=&amp;quot;managedHandler&amp;quot; type=&amp;quot;System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;&lt;br /&gt;		&amp;lt;/modules&amp;gt;&lt;br /&gt;		&amp;lt;handlers&amp;gt;&lt;br /&gt;			&amp;lt;remove name=&amp;quot;WebServiceHandlerFactory-Integrated&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;remove name=&amp;quot;ScriptHandlerFactory&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;remove name=&amp;quot;ScriptHandlerFactoryAppServices&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;remove name=&amp;quot;ScriptResource&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;add name=&amp;quot;ScriptHandlerFactory&amp;quot; verb=&amp;quot;*&amp;quot; path=&amp;quot;*.asmx&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; type=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;add name=&amp;quot;ScriptHandlerFactoryAppServices&amp;quot; verb=&amp;quot;*&amp;quot; path=&amp;quot;*_AppService.axd&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; type=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;add name=&amp;quot;ScriptResource&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; verb=&amp;quot;GET,HEAD&amp;quot; path=&amp;quot;ScriptResource.axd&amp;quot; type=&amp;quot;System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;&lt;br /&gt;		&amp;lt;/handlers&amp;gt;&lt;br /&gt;	&amp;lt;/system.webServer&amp;gt;&lt;br /&gt;	&amp;lt;runtime&amp;gt;&lt;br /&gt;		&amp;lt;assemblyBinding xmlns=&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&amp;gt;&lt;br /&gt;			&amp;lt;dependentAssembly&amp;gt;&lt;br /&gt;				&amp;lt;assemblyIdentity name=&amp;quot;System.Web.Extensions&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;bindingRedirect oldVersion=&amp;quot;1.0.0.0-1.1.0.0&amp;quot; newVersion=&amp;quot;3.5.0.0&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;/dependentAssembly&amp;gt;&lt;br /&gt;			&amp;lt;dependentAssembly&amp;gt;&lt;br /&gt;				&amp;lt;assemblyIdentity name=&amp;quot;System.Web.Extensions.Design&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot;/&amp;gt;&lt;br /&gt;				&amp;lt;bindingRedirect oldVersion=&amp;quot;1.0.0.0-1.1.0.0&amp;quot; newVersion=&amp;quot;3.5.0.0&amp;quot;/&amp;gt;&lt;br /&gt;			&amp;lt;/dependentAssembly&amp;gt;&lt;br /&gt;		&amp;lt;/assemblyBinding&amp;gt;&lt;br /&gt;	&amp;lt;/runtime&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; Well not to the problem...if you create this page and then try to upload a file thats below 50Mb it will all work fine...if its between 50Mb-&amp;gt;2Gb it will return change the text of the Label so it lets the user know that the file didnt get uploaded since its to big...but if you now try to upload a file thats more the 2Gb it wont return any message saying that the file were to big, actually it wont even fire the Buttons on_click event for some reason...and this is the problem since I actually want to let my users know that the file is to big even if its over 2Gb...and not just during the interval of 50Mb-2Gb...and well the problem as far as I have found out is that once the fileuploader browses to a file which size is over the maxRequestLength in the web.config it will cause this problem...so my question to all this is...&lt;/p&gt;&lt;p&gt;is there anyway to actually get around this so I still can detect if the file is to big even if its over 2Gb?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks in advance!&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>