How To create Open File Browser in asp.Net ..?
When i click a button it open File Browser pop-up in my asp.net Web Form application ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
keerthi saiPosted Nov 9, 2015, 8:11 AM
Ravi PatelPosted Nov 9, 2015, 7:36 AM
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class upload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void UploadButton_Click(object sender, EventArgs e)
{
if (FileUploader.HasFile)
try
{
FileUploader.SaveAs(Server.MapPath(DefaultFileName) +
FileUploader.FileName );
Label1.Text = "File name: " +
FileUploader.PostedFile.FileName + "
" +
FileUploader.PostedFile.ContentLength + " kb
" +
"Content type: " +
FileUploader.PostedFile.ContentType + "
Uploaded Successfully";
}
catch (Exception ex)
{
Label1.Text = "ERROR: " + ex.Message.ToString();
}
else
{
Label1.Text = "You have not specified a file.";
}
}
}