if (FileUpload1.HasFile) { byte[] img = new byte[FileUpload1.PostedFile.ContentLength]; FileUpload1.PostedFile.InputStream.Read(img, 0, FileUpload1.PostedFile.ContentLength); string file_ext = FileUpload1.PostedFile.FileName; string ext = Path.GetExtension(file_ext); Response.Write(FileUpload1.PostedFile.ContentLength); if ((ext.ToLower() == ".doc") || (ext.ToLower() == ".docx")) { File.WriteAllBytes(Server.MapPath("~/hello" + ext), img); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)