protected void Submit1_ServerClick(object sender, System.EventArgs e) { if ((File1.PostedFile != null) && (File1.PostedFile.ContentLength > 0)) { try { byte[] songData = null; using (var binaryReader = new System.IO.BinaryReader(File1.PostedFile.InputStream)) { songData = binaryReader.ReadBytes(File1.PostedFile.ContentLength); } if (System.IO.Path.GetExtension(File1.PostedFile.FileName) == ".txt") { ServiceAccessor.UploadSong(songData); } else { ServiceAccessor.UploadMultipleSongs(songData); } succ_msg.Attributes.Remove("hidden"); } catch (Exception ex) { err_msg.Attributes.Remove("hidden"); } } else { warn_msg.Attributes.Remove("hidden"); } }