How to upload a file to google drive?

8,917

Solution 1

There is a good tutorial here.

To summarize the link:

  • If not already installed, install curl
  • create Google security certificate
  • test from command line
  • create Python script to automate

Solution 2

send the file to your gmail account as attachment and from there you can save it to google drive directly.

uuencode file.txt file.txt | mail [email protected]

I know this is not direct to gdrive, but as there is no other options available I use this easy approach.

Share:
8,917

Related videos on Youtube

Арсен Мирзаян
Author by

Арсен Мирзаян

Updated on September 18, 2022

Comments

  • Арсен Мирзаян
    Арсен Мирзаян over 1 year

    I would like to just upload files to google drive from the command line. I don't care about synchronisation. I just want to upload things to google drive and if they exist they get replaced if not they are created.

    I know grive exists but that syncs everything from google drive to the folder you use which isn't what I want.

    I was wondering if there is a solution to this, through scp or something similar?

    thanks

    • Alex
      Alex about 10 years
      scp and rsync use ssh. AFAIK Google Drive doesn't offer ssh. rsync can also connect to a rsync daemon, but I doubt Google Drive offers that as well. AFAIK they don't even offer FTP, so probably the only way is creating a script using cURL.
    • Арсен Мирзаян
      Арсен Мирзаян about 10 years
      which kind of "hacks" it's way through the browser interface?
    • Oki Erie Rinaldi
      Oki Erie Rinaldi almost 7 years
      you can check this out github.com/prasmussen/gdrive
    • Oki Erie Rinaldi
      Oki Erie Rinaldi almost 7 years
      I just do ./gdrive-linux-x64 upload yourfile.rar. And Then yourfile.rar will be uploaded to your gdrive home folder
    • brasofilo
      brasofilo over 5 years
      The service Couchdrop.io acts as middleman and is free up to 1GB
  • brasofilo
    brasofilo over 5 years
    Nice trick, pity that's not exactly what's being asked. I need to send a big file and email attachments are restricted to 25MB
  • raj
    raj almost 3 years
    No way that can be called an "easy" approach.