# Permission denied when uploading gpkg to QFieldCloud using qfieldcloud\_sdk

**URL:** <https://community.qfield.org/t/permission-denied-when-uploading-gpkg-to-qfieldcloud-using-qfieldcloud-sdk/486>\
**Category:** Ask the Community\
**Tags:** gh-import\
**Created:** [14 May 2025 02:26 UTC](https://community.qfield.org/t/permission-denied-when-uploading-gpkg-to-qfieldcloud-using-qfieldcloud-sdk/486 "2025-05-14T02:26:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 02:26 UTC](https://community.qfield.org/t/permission-denied-when-uploading-gpkg-to-qfieldcloud-using-qfieldcloud-sdk/486/1 "2025-05-14T02:26:01Z")

</div>

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/](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…

```auto
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](https://github.com/opengisch/qfield/discussions/4050) by @troussell on 2023-03-16T18:45:46Z_

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 02:26 UTC](https://community.qfield.org/t/permission-denied-when-uploading-gpkg-to-qfieldcloud-using-qfieldcloud-sdk/486/2 "2025-05-14T02:26:02Z")

</div>

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](https://github.com/opengisch/QField/discussions/4050#discussioncomment-5354206) by @suricactus on 2023-03-18T16:19:10Z_

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 02:26 UTC](https://community.qfield.org/t/permission-denied-when-uploading-gpkg-to-qfieldcloud-using-qfieldcloud-sdk/486/3 "2025-05-14T02:26:04Z")

</div>

Thanks.

* * *

_Imported from [GitHub comment](https://github.com/opengisch/QField/discussions/4050#discussioncomment-5393696) by @troussell on 2023-03-22T14:19:45Z_

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 02:26 UTC](https://community.qfield.org/t/permission-denied-when-uploading-gpkg-to-qfieldcloud-using-qfieldcloud-sdk/486/4 "2025-05-14T02:26:05Z")

</div>

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

* * *

_Imported from [GitHub comment](https://github.com/opengisch/QField/discussions/4050#discussioncomment-9165336) by @9ls1 on 2024-04-19T10:56:30Z_

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 02:26 UTC](https://community.qfield.org/t/permission-denied-when-uploading-gpkg-to-qfieldcloud-using-qfieldcloud-sdk/486/5 "2025-05-14T02:26:07Z")

</div>

No. I gave up.

* * *

_Imported from [GitHub comment](https://github.com/opengisch/QField/discussions/4050#discussioncomment-9165555) by @troussell on 2024-04-19T11:25:33Z_
