Ankita Singhwal

Ankita Singhwal

  • NA
  • 1
  • 1.2k

To enter pdf and docx file in the database

May 16 2013 10:00 AM
 try
        {
            oCommonBLL.Extension = Path.GetExtension(FileResume.FileName);
            if (oCommonBLL.Extension == ".doc" || oCommonBLL.Extension == ".docx" || oCommonBLL.Extension == ".pdf")
            {
                int fileSize = FileResume.PostedFile.ContentLength;
                byte[] documentBinary = new byte[fileSize];
                FileResume.PostedFile.InputStream.Read(documentBinary, 0, fileSize);
                oCommonBLL.byResume = documentBinary;
            }
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError("Class:" + this.ToString() + " Method : " + System.Reflection.MethodBase.GetCurrentMethod().Name + "Error MSG :" + ex.Message);
        }

it is not giving correct output