Code for upload button:
protected void Btnupload_Click(object sender, EventArgs e)
{
int sizelimit = 5242880;
if (FileUpload1.HasFile)
{
if (FileUpload1.PostedFile.ContentLength <= sizelimit)
{
string path = "c:\\upload\\" + FileUpload1.FileName;
FileUpload1.SaveAs(path);
Label1.Text = "file uploaded to " + path;
}
else
Label1.Text = "file exceeds size limit.";
}
}

No comments:
Post a Comment
POST YOUR COMMENTS AND FAQ........