Possible bug? Could not find attribute: set_media at /downlink/anvil/google/drive.py

What I’m trying to do:
save a file into google drive
What I’ve tried and what’s not working:
use set_media()
I got this error:
AttributeError: Could not find attribute: set_media at /downlink/anvil/google/drive.py, line 103 called from /downlink/anvil/google/drive.py, line 233 called from [ServerModule1, line 18](javascript:void(0)) called from [Form1, line 14](javascript:void(0))

Code Sample:

# this is a formatted code snippet.
Client 
class Form1(Form1Template):
  def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)
    anvil.server.call('say_hello',self.image_1.source)

-------------------
server
@anvil.server.callable
def say_hello(name):
  f = app_files.test
  f.set_media(name)
# paste your code between ``` 

Clone link:
https://anvil.works/build#clone:EIJFZ6GNOB2WQWWI=66UFCEJASBIXEQE5YZO7IOTO
share a copy of your app

What is app_files.test?

According to the docs (Anvil Docs | Files, Media and Binary Data), set_media is used on an existing document to replace its contents. If app_files.test is a folder, you’d need to use create_file instead.

1 Like

app_files.test is folder in my google drive

What I am trying to do is to:
1- save a pdf file from data table directly into a google drive folder, creat_file() method, creates a document
2- get the url link of this saved pdf file

Not a bug, is just me not searching correctly :face_with_peeking_eye:, please see