Search This Blog

Tuesday, November 2, 2021

How to create list of all file name from your google drive folder !!!

Step 1.  Create a random spreadsheet from your google account. 

Step 2. Click on  spreadsheet Tools >> Script editor  (There will be open a new tab with javascript editor)



Step 3. Clear the editor and Copy Pest the below code and press on save button like below image .

function ListExportFunction() {
  var folderName = 'SEAMAP_GA_Longline'; // Google Drive Just Folder Name
  var folderlisting = 'listing of folder ' + folderName;
  
  var folders = DriveApp.getFoldersByName(folderName)
  var folder = folders.next();
  var contents = folder.getFiles();
  var contents = folder.getFiles();
  
  var ss = SpreadsheetApp.create(folderlisting);
  var sheet = ss.getActiveSheet();
  sheet.appendRow(['name','link']);
  
  var file;
  var name;
  var link;
  var row; 
  while(contents.hasNext()){
    file = contents.next();
    name = file.getName();
    link = file.getUrl();
    sheet.appendRow([name, link]);
  } };


Step 4. Finally Run the code by clicking run button like below image.  ( In this time browser may ask for allow to access your google drive. You have to allow it. Don't worry it's google script editor so it's safe )


Step 5. After successfully execution there will show a completed message like below image. 


That's  All. Now Check Your Drive Home Page With Your Folder Name Including "
listing of folder"  File Name. 



No comments:

Post a Comment

Restrict File Upload by File Type in Oracle Apex

If you want to restrict file upload by file type/extension/format you can follow the below steps.  Goto File Browser Item --> Advanced --...