Thursday, 18 October 2012

upload doc file in asp.net with c#



try
                {
                    {

                        FileUpload1.SaveAs(MapPath("Resumes/" + FileUpload1.FileName.ToString()));
                        string fn = "Resumes/" + System.IO.Path.GetFileName("Resumes/" + FileUpload1.PostedFile.FileName.ToString());

                       
                        con.insert_data("insert into Career values('"+name+"','"+contact+"','"+email+"','"+applied+"','"+exper+"','"+fn+"')");
                       
                        RMG.Functions.MsgBox("Your Entry hasbeen successfully");
                       
                        txt_name.Text = "";
                        txt_cnumber.Text = "";
                        txt_email.Text = "";
                        txt_appliedfor.Text = "";
                        DropDownList1.SelectedIndex = 0;
                       
                     
                    }
                 
                }
                catch (Exception ex)
                {
                    RMG.Functions.MsgBox("File Name is Too Long!!");
                }


No comments:

Post a Comment