Can't upload local files in colab

Using Google’s colab in Brave browser (Mac High Sierra 10.13.6). Trying to upload local file:

from google.colab import files
uploaded = files.upload()

Results:

---------------------------------------------------------------------------
MessageError                              Traceback (most recent call last)
<ipython-input-1-21dc3c638f66> in <module>()
      1 from google.colab import files
----> 2 uploaded = files.upload()

2 frames
/usr/local/lib/python3.6/dist-packages/google/colab/_message.py in read_reply_from_input(message_id, timeout_sec)
    104         reply.get('colab_msg_id') == message_id):
    105       if 'error' in reply:
--> 106         raise MessageError(reply['error'])
    107       return reply.get('data', None)
    108 

MessageError: TypeError: Cannot read property '_uploadFiles' of undefined  

Cannot load.
Expected to be identical to Chrome browser - Allow me to select my local file for upload into colab.

@solarslurpie,
Can you try opening the Shields panel and change the Device Recognition setting to Allow all... and see if that allows you to upload the file?

@Mattches,
Thank you. I tried your suggestion. It did not fix the problem.

can u please try:

from google.colab import files
uploaded = files.upload()

thank you.

Hey @solarslurpie, yeah we could reproduce the issue. Just click on “Allow all cookies” on the site, it should let the the python script to run. Also have logged a ticket for this issue.

1 Like

Thank you. Verified it worked.

1 Like