From eec9743f282b475f60068341409c1957d3eb24cb Mon Sep 17 00:00:00 2001 From: Ryan Brewster Date: Wed, 1 Mar 2017 15:41:54 -0800 Subject: [PATCH] Change `object.path` to `object.name` This code is not working for me. It is failing when trying to run `filePath.split('/')` because `filePath` is undefined. If I dump the `object` to logs, I see that it has a `.name` but not a `.path`. --- quickstarts/thumbnails/functions/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstarts/thumbnails/functions/index.js b/quickstarts/thumbnails/functions/index.js index 7e1fbb7f41..2f40be9e8c 100644 --- a/quickstarts/thumbnails/functions/index.js +++ b/quickstarts/thumbnails/functions/index.js @@ -33,7 +33,7 @@ exports.generateThumbnail = functions.storage.object().onChange(event => { const object = event.data; // The Storage object. const fileBucket = object.bucket; // The Storage bucket that contains the file. - const filePath = object.path; // File path in the bucket. + const filePath = object.name; // File path in the bucket. const contentType = object.contentType; // File content type. const resourceState = object.resourceState; // The resourceState is 'exists' or 'not_exits' (for file/folder deletions). // [END eventAttributes]