Maximum file size was exceeded

Oct 9, 2014 at 7:28 AM
I am facing a problem when user uploads a file with size more than 50 MB. Ftp code is throwing exception "Maximum file size was exceeded". I have placed code below, can anybody help me I need it on urgent basis.
if (ftp.IsConnected)
                                {
                                    var destPath = Convert.ToString(Session["fullpath"]);
                                    int BUFFER_SIZE = file.ContentLength; // 64KB buffer
                                    byte[] buffer = new byte[file.ContentLength];
                                    using (Stream readStream = file.InputStream)
                                    using (Stream writeStream = ftp.OpenWrite(string.Format("{0}/{1}", destPath, file.FileName)))
                                    {
                                        while (readStream.Position < readStream.Length)
                                        {
                                            buffer.Initialize();
                                           int bytesRead = readStream.Read(buffer, 0, BUFFER_SIZE);
                                           writeStream.Write(buffer, 0, bytesRead);
                                       }
                                        ViewState["fileContentLenght"] = file.ContentLength;
                                        writeStream.Flush();

                                    }
                                }