Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
How to upload video on web site
Ajay Raj
May 5 2012 7:56 AM
1.2k
Reply
Hi,
Sir I want to upload video upload on the ASP.NET , Click on the submit Button then disconnect the web browser.
please resolve the problem.
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
String fileName = FileUpload1.FileName;
String fileExtension = Path.GetExtension(fileName).ToLower();
if (fileExtension.Equals(".flv") || fileExtension.Equals(".wmv"))
{
if (!File.Exists(Path.Combine(Server.MapPath("~/video/"), fileName)))
{
String fullFileName = Path.Combine(Server.MapPath("~/video/"), fileName);
FileUpload1.SaveAs(fullFileName);
lbl_v_msg.Text = "Uploaded Successfully......";
}
else
{
lbl_v_msg.Text = "That file already exists! You must delete the current version to add an updated version.";
}
}
else
{
lbl_v_msg.Text = "Only .flv or .wmv files are allowed!";
}
}
else
{
lbl_v_msg.Text = "Select a file to upload!";
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Caching
How to found price in DB by the id selected element use jquery?