2

I have a byte array that contains the data of an uploaded file which happens to be a Resume of an employee(.doc file). I did it with the help of the following lines of code

    AppSettingsReader rd = new AppSettingsReader();

    FileUpload arr = (FileUpload)upresume;
    Byte[] arrByte = null;
    if (arr.HasFile && arr.PostedFile != null)
    {
        //To create a PostedFile
        HttpPostedFile File = upresume.PostedFile;
        //Create byte Array with file len
        arrByte = new Byte[File.ContentLength];
        //force the control to load data in array
        File.InputStream.Read(arrByte, 0, File.ContentLength);
    }

Now, I would like to get the contents of the uploaded file(resume) in string format either from the byte array or any other methods. PS: 'contents' literally refers to the contents of the resume; for example if the resume(uploaded file) contains a word 'programming', I would like to have the same word contained in the string. Please help me to solve this.

4

1 回答 1

0

几年前我做过一个类似的项目。长话短说...我最终重建了文件并将其保存在服务器上,然后以编程方式将其转换为 pdf,然后索引 pdf 的内容,这在当时的实践中证明要容易得多。

或者,如果您可以将简历上传限制为 docx 文件格式,则可以使用 Microsoft 的 OpenXML 库非常轻松地解析和索引内容。但在实践中,这可能会导致网站用户的可用性问题。

于 2013-04-09T21:43:28.003 回答