Permission denied when uploading gpkg to QFieldCloud using qfieldcloud_sdk

Using the QFieldCloud SDK I can list my QFieldCloud projects and download files, but I get the following error when trying to upload and overwrite existing gpkg files. Is this possible?

‘status’: <FileTransferStatus.FAILED: ‘FAILED’>, ‘error’: Requested “https://app.qfield.cloud/api/v1/packages/jjj/ppp/files/OperationPOI.gpkg/” and got “403 Forbidden”:
{
“code”: “permission_denied”,
“message”: “Permission denied”
}

Here is the code I am using…

my_token = "ttt"
download_dpath = r"my_download_dpath"
project_dpath = r"my_project_dpath"

client = sdk.Client(
url="https://app.qfield.cloud/api/v1/",
token=my_token
)

try:
        projects = client.list_projects()
        for project in projects:
            if project['name'] == 'OperationPOI':
                project_id = project['id']
               # download files to an import directory
                client.package_download(project_id,download_dpath)

                # make some changes to the gpkg files in the original project directory
                ...
                # at this point I can manually use QGIS to synchronize the package, but I would like this stop to be 
                # automated using this script

                upload_type = sdk.FileTransferType.PACKAGE
                job_id = uuid.uuid4()
                local_files = client.upload_files(project_id=project_id,project_path=project_dpath,upload_type=upload_type,filter_glob="*.gpkg",job_id=job_id)
                print (local_files)
except requests.exceptions.RequestException:
        print("Oops!")

Imported from GitHub discussion by @troussell on 2023-03-16T18:45:46Z

Regular users cannot upload sdk.FileTransferType.PACKAGE, it is something used internally in QFieldCloud. You still can upload the regular QGIS files via the SDK with sdk.FileTransferType.PROJECT` and have a package from the cloud though.


Imported from GitHub comment by @suricactus on 2023-03-18T16:19:10Z

Thanks.


Imported from GitHub comment by @troussell on 2023-03-22T14:19:45Z

troussell did you manage uploading project/data using qfieldcloud_sdk and sdk.FileTransferType.PROJECT? I’m facing problems, see #5196


Imported from GitHub comment by @9ls1 on 2024-04-19T10:56:30Z

No. I gave up.


Imported from GitHub comment by @troussell on 2024-04-19T11:25:33Z