Skip to content

Attachment no data #75

Open
Dexus opened this Issue Dec 26, 2013 · 0 comments

1 participant

@Dexus
Dexus commented Dec 26, 2013

I can only save daten with this function:

mailparser.on("attachment", function(atta){
    //self.loginfo(connection, "\x1B[31mattachment:" + JSON.stringify(atta, null, 4)+'\x1B[39m');

    fs.mkdir(config.save.mainpath + '/' + connection.uuid, function(err){
    });
        var output = fs.createWriteStream(config.save.mainpath + '/'  + connection.uuid +
        '/' + atta.contentId.replace(/[^a-zA-Z0-9-_]/g,'_') + "_" + atta.generatedFileName);

        atta.stream.pipe(output);

});

but if i try to use this:

mailparser.on("attachment", function(atta){
    //self.loginfo(connection, "\x1B[31mattachment:" + JSON.stringify(atta, null, 4)+'\x1B[39m');

    fs.mkdir(config.save.mainpath + '/' + connection.uuid, function(err){
        var output = fs.createWriteStream(config.save.mainpath + '/'  + connection.uuid +
        '/' + atta.contentId.replace(/[^a-zA-Z0-9-_]/g,'_') + "_" + atta.generatedFileName);

        atta.stream.pipe(output);
    });
});

I create only "null" files - Without Content.

Have someone a solution for my problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.