domingo, mayo 12, 2019

Get share link of multiple files in Google Drive to put in spreadsheet

De: https://webapps.stackexchange.com/questions/88769/get-share-link-of-multiple-files-in-google-drive-to-put-in-spreadsheet

3

2

I've got 200+ jpegs in a folder and need shareable links for each jpeg in a spreadsheet. Is there a way to do this without doing the right clicking thing for each image individually?

google-drive links

shareimprove this question

edited Jan 16 '16 at 22:00


ale

42.3k25111255

asked Jan 16 '16 at 21:48


Leon Moon

16112

add a comment

2 Answers

activeoldestvotes

2

Yes, you can select all these files and get shareable links to them at once.

  1. Select files
  2. Right-click any of them and pick "Share.." out of the context menu.
  3. Click "Get shareable links" in the upper right corner of the Share dialog window. This does several things at once: makes files accessible to anyone with a link, and copies the links to your clipboard.
  4. Paste into the spreadsheet. The copied links are newline-separated, so when pasted into a spreadsheet, they form a neat column.

12.3k71736

answered Jan 17 '16 at 5:45

user79865

A method without painful clicking is the following:

Open the desired Google Drive folder and get the [ID] in its URL from the browser location bar:

https://drive.google.com/drive/u/0/folders/[ID]

Open a new Google Sheet and navigate Tools > Script editor.
In the new script, put (replace the [ID] in the code):

function myFunction() {
  var ss=SpreadsheetApp.getActiveSpreadsheet();
  var s=ss.getActiveSheet();
  var c=s.getActiveCell();
  var fldr=DriveApp.getFolderById("REPLACE_[ID]_HERE");
  var files=fldr.getFiles();
  var names=[],f,str;
  while (files.hasNext()) {
    f=files.next();
    str='=hyperlink("' + f.getUrl() + '","' + f.getName() + '")';
    names.push([str]);
  }
  s.getRange(c.getRow(),c.getColumn(),names.length).setFormulas(names);
}

Run the script (after having saved it and granted permissions) and revisit the Google Sheet, which should now contain the list of URLs.

(I stole most of this from https://productforums.google.com/forum/#!topic/docs/0ilSDjhFnHI)


https://chrome.google.com/webstore/detail/extract-drive-links/klonacpfbangpegffkdopiilfdhgjhgo



De: https://www.syncwithtech.org/google-drive-direct-links/ 

https://gsuite.google.com/marketplace/app/drive_direct_links/520711270513

How to Get Direct Download Links of Google Drive Files

Published: 6th Feb, 2018

Last Updated: 13th Apr, 2019

3 min read

3 years ago, I had shared a tool to generate direct download link for a Google Drive file. But what if you need to create direct links for the files inside a specific folder or simply all your drive files. There's a Sheets Add-on which lets you do it.

Google Drive Direct Download links

How to Generate direct links

Upon installation, it requires permission to access your Google drive files.
Basically, there are two ways you can use this add-on.

1. Files inside specific folders

Using this feature, you can select the list of folders you want. All the files inside those folders will be exported to a sheet.

2. All the files inside Google drive

Simply all your files are exported to a sheet.

File details include folder name, path of the folder on Google Drive, file name, direct link & with whom you've shared the file. Each row on spreadsheet represents a file on your Drive.

drive-direct-link-sheet

How to install & use

You can install the Add-on using this link - Direct Download links for Google Drive. Click INSTALL, it will ask for your permission. Click Continue and choose your Google account to authorize the app.

Now you're all set to use the Add-on, on your sheet select Add-ons → Direct Drive Links → Generate Links. A pop-up opens as showed in the image below.

drive direct links sheets add-on select-folder-prompt

If you choose Selected folders, folder picker pop-up opens and you can select the folders you want. When you select All folders, the pop-up closes and a sheet opens with details of all your Google Drive files.

If you need links to the files shared with you, you have to tick the Include Shared with me folders checkbox.

Selected folders

Once you pick the folders, a pop-up opens with the list of folders you select. From that pop-up, you can add/remove a folder.

drive direct links sheets add-on folder list modal

You have to tick Recursively pick folders, if you want to cover the files inside nested folders. To explain this, let's take the following file system hierarchy.

    My Drive
    |--Folder 1
    |  |--File 1
    |  |--Folder 11
    |     |-- File 11
    |--Folder 2

Here, My Drive has two folders Folder 1 and Folder 2. Folder 1 contains a file File 1 and a folder Folder 11. Let's say your folder list contains only,

My Drice > Folder 1 >

So, if you select Generate without opting for recursive operation, you'll end up with File 1 info alone. If you had ticked the checkbox, your sheet will also have Folder 11 and File 11 entry.

Note: The sheet will generate pdf download links for Google Documents, Sheets and Presentations by default, however, you can change that by replacing pdf with xlsx or doc or pptx.

The best thing is you can also use this add-on as a Google Drive file manager by opting for All folders in the prompt. It'll simply list all your files.

Settings and Configuration

At any point of time, you can change the way you use this add-on. For example, if you want to pick folders after selecting all folders, you can do that by selecting Add-ons → Direct Drive Links → Select folders for links.

If you had selected too many unwanted folders and want to remove all at once, you can select Reset on the folder list pop-up.

For now, there are two configurations for you to use according to your needs,

1. Auto refresh

By default, whenever you open the sheet, it'll refresh the links automatically for you. But if you open the sheet more than once between 6-hour interval, automatic refresh won't happen. If you want to get the links to newly added files in the meantime, you can use Refresh Links option that's available under Add-ons → Direct Drive Links.

You can also disable the auto refresh option altogether, select Add-ons → Direct Drive Links → ✓ Autorefresh on open.

2. Repeat folder names

There is an option for you to repeat the folder path & names in column 2 & 3. When you sort by filename, to know within which folder every file is, you can use this. It is by default disabled, to enable it, just select Add-ons → Direct Drive Links → Repeat folder names. You can toggle if you want to disable later.

Open folders on Google Drive

Hover over the folder name in the first column and click on the link to view the folder contents on Google Drive.

Update Share details

If any of the files are not shared with anyone or you want to share that with more people, you can do that using your sheet, all you have to do is, hover over the file name for which you want to update share details, click on the link, you'll be redirected to the file preview page.

On the top right corner of the page, left to your profile picture, click on the menu and then Share. Now you can share that file with anyone you want.

Issues and Feature requests

If you run into any issues or you want any feature to be added to this add-on, do leave a comment on this post. I'll see what best I can do.

Ganapathy S

Written by Ganapathy, a Web developer by profession and a tech enthusiast.

Comments