FIleUPLOAD;;;
// string FilePath = FileuploadTxt.PostedFile.FileName;
// string FileName = Path.GetFileName(FilePath);
// string text = Path.GetExtension(FilePath);
// string contenttype = String.Empty;
// //Set the contenttype based on File Extension
// switch (text)
// {
// case ".doc":
// contenttype = "application/vnd.ms-word";
// break;
// case ".txt":
// contenttype = "application/vnd.ms-word";
// break;
// }
// if (contenttype != String.Empty)
// {
// Stream fs = FileuploadTxt.PostedFile.InputStream;
// BinaryReader br = new BinaryReader(fs);
// Byte[] bytes = br.ReadBytes((Int32)fs.Length);
// Raya.API.Mailupload objmail = new Raya.API.Mailupload();
// //objmail.Id = BitConverter(bytes);
// objmail.Data = FileName;
// objmail.Insert();
// //int n = fs.Read((FileName, bytes);
// lblmsg.Text = "File Uploaded Successfully";
// }
// else
// {
// lblmsg.Text = "File format not recognised." + "Upload Image/Word/PDF/Excel formats";
// }
//}
// string FilePath = FileuploadTxt.PostedFile.FileName;
// string FileName = Path.GetFileName(FilePath);
// string text = Path.GetExtension(FilePath);
// string contenttype = String.Empty;
// //Set the contenttype based on File Extension
// switch (text)
// {
// case ".doc":
// contenttype = "application/vnd.ms-word";
// break;
// case ".txt":
// contenttype = "application/vnd.ms-word";
// break;
// }
// if (contenttype != String.Empty)
// {
// Stream fs = FileuploadTxt.PostedFile.InputStream;
// BinaryReader br = new BinaryReader(fs);
// Byte[] bytes = br.ReadBytes((Int32)fs.Length);
// Raya.API.Mailupload objmail = new Raya.API.Mailupload();
// //objmail.Id = BitConverter(bytes);
// objmail.Data = FileName;
// objmail.Insert();
// //int n = fs.Read((FileName, bytes);
// lblmsg.Text = "File Uploaded Successfully";
// }
// else
// {
// lblmsg.Text = "File format not recognised." + "Upload Image/Word/PDF/Excel formats";
// }
//}
Comments
Post a Comment