4

Someone shared a batch of folders and files to me. The total number and size is quite large and I want to avoid download all of them and upload back to my Google Drive.

I have tried checking multiple items and then copy them. It will make all the selected files copied to my Drive with a - copy filename suffix. But this method wouldn't apply on folders, so folder structure is not reserved and I have to repeat the steps many times.

May I know any work around, tool or technique I can use?

2 Answers 2

3

If you're comfortable using Google Scripts the following from Amit works well for me. I've looped it with an array of folder names grabbed from a spreadsheet to deal with lots of content.

function start() {

var sourceFolder = "source";//name of the source folder
var targetFolder = "target";

var source = DriveApp.getFoldersByName(sourceFolder);
var target = DriveApp.createFolder(targetFolder);

if (source.hasNext()) {
copyFolder(source.next(), target);
}

}

function copyFolder(source, target) {

var folders = source.getFolders();
var files   = source.getFiles();

while(files.hasNext()) {
var file = files.next();
file.makeCopy(file.getName(), target);
}

 while(folders.hasNext()) {
var subFolder = folders.next();
var folderName = subFolder.getName();
var targetFolder = target.createFolder(folderName);
copyFolder(subFolder, targetFolder);
}  

}
0

In Google Drive, click 'Shared with Me', right click the folder, and click 'Add to My Drive'. This will make the folder and all sub-folders and files appear in your main Drive.

2
  • However the folders and files will be lost if my friend delete them later? I need to keep a copy myself.
    – Mark
    Nov 9, 2015 at 5:54
  • Then you should click 'Make a Copy' instead of 'Add to My Drive' in the right-click menu. Keep in mind, though, that the file copy that will now be in your My Drive folder will no longer be sync with other users's versions. Nov 9, 2015 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.