I just need to read the content of a file(no need to download the file) and store the data into my application. I am able to get the content of a file in response by using this api "https://www.googleapis.com/drive/v3/files/fileId?alt=media". But the response of this api returns an unreadble format, something like this "�dҚ�ȳ:\u0010��$���2�m��L̆���✳ŝ-�lqg�;[����O�s�\u0011�\u001bk\".
Below is the code I am using. This is Gdrive api v3.
drive.files.get(
{
fileId: fileId,
alt: "media",
},
(err, res) => {
if (err) {
console.log("err = ", err);
return false;
}
if (res) {
console.log("File Details");
console.log(res);
}
}
);
How can I get the data in readable format?