Reputation: 145
I've just created a copy of a file with a new name using this command:
file.makeCopy(''+newfilename+'');
How can I find the ID of the new file?
Upvotes: 0
Views: 456
Reputation: 38416
Use the following
var copy = file.makeCopy('Put the new file name here');
var id = copy.getId();
Related
Upvotes: 0
Reputation: 27390
If you check the official documentation, you will see that makeCopy() returns an object of the class File.
The latter has a method getId() which gives you the id of the File
.
const newFile = file.makeCopy('newfilename'); // it returns an object of type File
const newFileID = newFile.getId(); // File has a method .getId()
Upvotes: 1