DEV Community

Cover image for Remote Upload in Google Drive
mohammed hossein mazandaranian
mohammed hossein mazandaranian

Posted on

10

Remote Upload in Google Drive

This tutorial also has been written in Persian language:
https://vrgl.ir/8Lghf

Remote upload enables you to upload files and programs from any URL to your cloud.
Hopefully we have this feature in Google Drive, but Google Drive doesn't provide this directly to us and we must use Google Colab to achieve it.by the way i made video for this tutorial, you can watch it if you wish.

ok let's start it.
first things first sign into google colab (same as gmail). create a new notebook, now we must mount out google drive in colab, so write this code and run it:

from google.colab import drive
drive.mount('/content/drive')

when you run above code, it gives you a link, click on it and give it access to your account, copy the api code and paste it in the field then hit enter.
Remote upload in google drive

now create new field and write this code:
!wget -P /content/drive/MyDrive/newFolder/

the address in front of -P is path you want your file saved there, so you can change whatever after /MyDrive/ path.

now in front of the code, write your file's url you want to download, here i want to download a mp3 file but you can download pdfs, videos and etc...
!wget -P /content/drive/MyDrive/newFolder/ https://www.bensound.com/bensound-music/bensound-hey.mp3

now run it, you can see the result:

Remote upload in google drive

now if you go to your google drive, you can see that your file is downloaded.

Remote upload in google drive

Image of Bright Data

Feed Your Models Real-Time Data – Enhance your AI with up-to-the-minute data.

Utilize our live data feeds for dynamic model training, ensuring your AI systems are always ahead.

Access Real-Time Data

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay