upload file to google drive with and without persistancy ∞ Google Colab Snippets
file(s) upload
After running the:
from google.colab import files
uploaded_files = files.upload()
you will get button for file(s) upload
the upload_files is dictionary containing file names as keys and file content as value.
preview
you can easily preview the files, evne binary ones with files.view('filename.png')
where are my files???? Why were they lost?
When you upload your files you might be suprised why this are not visible inside the google drive
This files are just temporary for lifetime of running the notebook, until you….
mount your google drive
from google.colab import drive
drive.mount('/content/drive')
WARNING: you will be prompted by google to gran notebook runtime to your google drive
after navigating to proper directory and running upload again, you will find now your files persisted inside your gdrive