我想批量上传zip文件中的简历,并提取html5和angular中每个简历的内容

I want to bulk upload the resumes in zip file and extract the content of each resume in html5 and angular

本文关键字:html5 提取 angular 文件 zip      更新时间:2023-09-26

我使用以下服务提取并获取zip文件的内容。我想读一下文件的内容,放在角度的范围内。如有任何建议,我们将不胜感激。我的功能看起来像这个

.factory("extractAndParse", ["$q", function($q) {
    function unzip(zipfile) {
        var dfd = $q.defer();
        var reader = new FileReader();
        reader.onerror = dfd.reject.bind(dfd);
        reader.onload = function(e) {
            if (!reader.result) dfd.reject(new Error("Unknown error"));
                var zip = new JSZip(reader.result);
                var file = zip.files['CVLIST/Rabin.docx'];
                if (typeof file === 'undefined') {
                    dfd.reject(new Error('package.json does not exist'));
                }
                return dfd.resolve(file.asText());
            };
            reader.readAsArrayBuffer(zipfile);
            return dfd.promise;
        }
        function extractAndParse(zipfile) {
            return unzip(zipfile)
        }
        return extractAndParse;
}])

现在它说.asText()不起作用。

您可能需要在这里使用一些标准函数来代替asText(),如这里指定的:

https://www.w3.org/TR/FileAPI/#APIASynch