Reading file located in the server, and upload it server side to FSCollection

I’m generating a PDF file based on a template and storing it in the server. I do this with a server method, thanks to the following code (package PDFKit):

var doc = new PDFDocument({size: 'A4', margin: 50});
doc.text(contractParts[0].textual, 10, 30, {align: 'center', width: 200});
var path = process.env.PWD + '/../PDFKit/contrato_'+student.nif+"_"+courseId;
var result = doc.writeSync(path);

I’m successful at this and I can see the files created at a local folder in the server.

Now, what I want, is to store that auto-generated PDF in a FSCollection, so right after the code above, I do this:

var fsFile = fs.readFileSync(path, 'utf8', function (err, data) {
if (err) {
 console.log('Error: ' + err);
Fiber(function() {
FSDocuments.insert(JSON.parse(fsFile), function (err) {
 if (err) throw err;


(Sorry for the bad indentation, I do not know if there is anyway to format the code).

I’ve tried both FSDocuments.insert(JSON.parse(fsFile), function (err)) and FSDocuments.insert(fsFile, function (err)(, but none of them are working, they are throwing errors, the first about unexpected token in JSON file, and the second about null bytes in path not allowed. I am at loss with this. What is the correct way to do a server side FS file upload from a server side file read?