Sensitive
Server Data Info Leakage
Password Protected File Validation for(.doc/.docx/.xls/.xlsx/.pdf) file types protected void btnUpload_Click( object sender, EventArgs e) { //Check if File Upload control has file or not if (FileUpload1.HasFile) { //Get Uploaded file bytes var bytes = FileUpload1.FileBytes; //Get Uploaded File Extension FileInfo objFileInfo = new FileInfo (FileUpload1.FileName); string StrFileExt = objFileInfo.Extension.ToUpper(); //Based on the File extension call appropriate user defined method. //For PDF file type if (StrFileExt == ".PDF" ) { //Upload and save file in server temp folder var newfilename = DateTime .Now.GetHashCode() + FileUpload1.FileName; FileUpload1.SaveAs(Syst
Comments
Post a Comment