This is my code to upload video on server
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string fileName = FileUpload1.FileName;
string fileExtension = Path.GetExtension(fileName);
if (fileExtension == ".flv")
{
if (!File.Exists(Path.Combine(Server.MapPath("~/Video"), fileName)))
{
string fullFileName = Path.Combine(Server.MapPath("~/Video1"), fileName);
FileUpload1.SaveAs(fullFileName);
Label1.Text = "The file has been uploaded";
}
else
{
Label1.Text = "The file already exist! You must delete old version first in order to upload new version";
}
}
else
{
Label1.Text = "The file format is not allow";
}
}//else if
else
{
Label1.Text = "please select a file to upload";
}
}
Everything is goes well, but when I upload a .FLV file, It returns me an error message on webpage,here is the error code
Output: Error 101 (net::ERR_CONNECTION_RESET): The connection was
reset.
How can I solve this problem?
Maybe you are trying to upload a file larger than 4MB which is the default maximum allowed size. You may try increasing it in the
web.config: