Skip to content

Latest commit

 

History

History
76 lines (45 loc) · 2.77 KB

README.md

File metadata and controls

76 lines (45 loc) · 2.77 KB

Batch Rename Multiple Dropbox Files using Dropbox API V2

This example uses the Official Dropbox API V2 SDK for Javascript to search and rename files.

Installation 🛠

  1. Create an app via the Developer Console

  2. In the Developer Console, navigate to the App Console > Your Application > Permissions to add files.metadata.read and files.content.write permissions to your app scopes

  3. Install from the source:

    git clone https://github.com/chriskyfung/dropbox-file-renamer.git
    cd dropbox-file-renamer
    npm install
  4. Create a .env file in your project directory

  5. Generate and copy the access token from the App Console to .env file, for example:

    ACCESS_TOKEN=your_access_token
    

How to Use 🔰

  1. Open the index.js file in Visual Studio Code

  2. Modify the query string passed to the filesSearchV2() to search for your target files

  3. Modify the regular expression and replacement for the filename.replace() methods to generate the new filenames of the matched files

  4. Run the script using

    node index.js

    or

    npm start

Examples

You can execute an example script using the following command in your terminal:

node ./example/[target-script-name].js
  • file_search_v2.js - Searches for files and folders using the /files/search_v2 and /files/search/continue_v2 endpoints

  • ilst_folder.js - Lists the items of a folder using the /files/list_folder and /files/list_folder/continue endpoints

Learn More 📚

Like my stuff?

Would you like to buy me a coffee? I would really appreciate it if you could support me for the development.

Buy Me A Coffee

License

Distributed under the GNU Affero General Public License v3.0