Hello,
when using a path to upload a file, like in the snippet below, the upload succeeds and even generates a valid link suggesting the file is saved. However it doesn’t show up in the file system.
The workaround i found is to replace file_path = "test_path" with file_path = "files/test_path"which then correctly makes the files show up in System folders/files/test_path.
from seatable_api import Base, context
base = Base(context.api_token, context.server_url)
base.auth()
file_name = "example.txt"
file_path = "test_path"
content = b"This is an example text file uploaded to SeaTable."
info_dict = base.upload_bytes_file(file_name, content,
relative_path=file_path,
file_type='file', replace=True)
print("Upload info:", info_dict)
i know its not necessary, but its part of the API and i need it for the use case. Its working with the workaround too, i just wanted to report it as a bug. I thought the forum is the place for that.
the bug is that when you want to specify a relative path it needs to include “files/” to work. i reported it because the api and documentation both say you can specify a relative path and because the files do get uploaded to somewhere, they’re just not accessible.
I know i could just upload without a relative path, but then the next person will be confused too. now they might see this forum post and use the workaround, or the bug could be fixed.
Should i write a bug report to customer support or open a github issue?
im referring to the upload_bytes_file method from this documentation, where the relative file path hasnt been documented (yet). however, there is a bug in the implementation, if you look at my example code above, just adding a relative file path will upload the file to some inaccessible location (except via the url), only when adding “file/” to the file path argument yourself will you get the expected behavior. i dont know whether that bug exists outside of the python api.
Do it like thousands of other people who have used SeaTable to develop powerful processes and get their ideas and tasks done more efficiently.