I am having some issues with my code. I am trying to loop through a Drive folder that contains many PDFs and then merge these into one file. When I use my code it just creat
The .getBytes()
method returns a binary array for each file, so what you're created is an array of arrays with:
blobs.push(files[i].getBlob().getBytes());
Instead, I'd concatenate the array for the current item in the loop with an accumulator array that grows with each loop iteration. Then, after exiting the loop the contents of the accumulator array can be passed into .newBlob()
or .setBytes()