I have been having some issues with the google drive API and teamdrives. I can\'t for the life of me, figure out how to upload a file to team drive.
I\'m able to upload
Try this one from Google uploads
Also read this: Simple upload
var fileMetadata = {
'name': 'photo.jpg'
};
var media = {
mimeType: 'image/jpeg',
body: fs.createReadStream('files/photo.jpg')
};
drive.files.create({
resource: fileMetadata,
media: media,
fields: 'id'
}, function (err, file) {
if (err) {
// Handle error
console.error(err);
} else {
console.log('File Id: ', file.id);
}
});