Skip to content

The file upload service of serverpod does not support the China region #2229

Open

Description

@Metaildust

Discussed in #2226

Originally posted by Metaildust May 9, 2024
The file upload service of serverpod does not support the China region. China only has AWS service and not Google service. Currently, if the China region wants to use file upload, it can only use S3. But due to the fact that S3 in the Chinese region is represented by Chinese service providers and is independent of the international version. However, using the Chinese version of AWS may encounter some compatibility issues, such as the inability of the Chinese version of AWS service to create a certificate for us east-1. If you create a US-EAST-1 certificate alone in the international zone, you will encounter some other issues. If possible, please support AWS S3 services in China as soon as possible.

Activity

  1. MachineL102 commented on Jun 12, 2024

    @MachineL102

    I change the US-EAST-1 in tf script to ap-east-1, it seems work but with a little issue occurd in codedeploy phase(I always thought that the yum command used in init-script.sh caused the AWS CodeDeploy failure.).
    I'm not familiar with aws,I wan't to konw if there will be problem with selecting ap-east-1 in the international zone.

  2. added
    area: storage
    area: deployment
    on Jan 3, 2025
  3. SandPod commented on Aug 8, 2025

    @SandPod
    Contributor

    Additional details in the closed duplicate issue by @Metaildust:

    At present, the main storage services supported by ServerPod are Google and AWS. But for Chinese users, due to legal restrictions, data cannot be stored on servers outside of China, which brings some compatibility issues for Chinese users.
    The server market in China is mainly dominated by Alibaba Cloud and Tencent Cloud. Although AWS also has branches in China, some features of the international version of AWS are not compatible with AWS in China, and the price of AWS in China is relatively more expensive compared to servers provided by other vendors.

    For the China region, the best option is to support Alibaba Cloud's services. Currently, Alibaba Cloud Storage already has package like dart_aliyun_oss(new but strong, works both for serverside or client side, support generate signed url) or like flutter_oss_aliyun(old but more used, designed for client using sts token only, but support multipart upload).
    If serverpod is working on add more ability, perhaps we can include Aliyun oss storage services in the serverpod development plan to make it a built-in strategy. It won't be a lot of work rely on dart_aliyun_oss package but extremely user-friendly. Thanks.

  4. Metaildust commented on Jan 31, 2026

    @Metaildust
    Author

    @SandPod
    Update: I built and published a Tencent COS CloudStorage adapter that matches Serverpod's official file upload API (createDirectFileUploadDescription / FileUploader)https://pub.dev/packages/serverpod_cloud_storage_cos https://pub.dev/packages/tencent_cos_dart includes a server-side upload endpoint and uses passwords.yaml keys tencentCosSecretId/Key/Bucket/Region/CustomDomain. Happy to maintain for Serverpod 3.x. If you prefer, I can also submit it to serverpod/serverpod_plugins.

  5. marcelomendoncasoares commented on Feb 26, 2026

    @marcelomendoncasoares
    Collaborator

    @SandPod Update: I built and published a Tencent COS CloudStorage adapter that matches Serverpod's official file upload API (createDirectFileUploadDescription / FileUploader)https://pub.dev/packages/serverpod_cloud_storage_cos https://pub.dev/packages/tencent_cos_dart includes a server-side upload endpoint and uses passwords.yaml keys tencentCosSecretId/Key/Bucket/Region/CustomDomain. Happy to maintain for Serverpod 3.x. If you prefer, I can also submit it to serverpod/serverpod_plugins.

    @Metaildust This nearly slipped by me, but to not leave it unanswered: we're currently working on a major improvement to the cloud storage implementations on #4771. After this PR is merged, if you want to contribute with the Tencent package that you've built, we'll be happy to have it as an official Serverpod package!

  6. Metaildust commented on Feb 27, 2026

    @Metaildust
    Author

    @SandPod Update: I built and published a Tencent COS CloudStorage adapter that matches Serverpod's official file upload API (createDirectFileUploadDescription / FileUploader)https://pub.dev/packages/serverpod_cloud_storage_cos https://pub.dev/packages/tencent_cos_dart includes a server-side upload endpoint and uses passwords.yaml keys tencentCosSecretId/Key/Bucket/Region/CustomDomain. Happy to maintain for Serverpod 3.x. If you prefer, I can also submit it to serverpod/serverpod_plugins.

    @Metaildust This nearly slipped by me, but to not leave it unanswered: we're currently working on a major improvement to the cloud storage implementations on #4771. After this PR is merged, if you want to contribute with the Tencent package that you've built, we'll be happy to have it as an official Serverpod package!

    Hi @marcelomendoncasoares
    Let me know here when it's time to propel!

  7. marcelomendoncasoares commented on Mar 12, 2026

    @marcelomendoncasoares
    Collaborator

    Hey @Metaildust! We have already merged the improvements to the Cloud storage implementation, so feel free to open your PR with the Tencent COS when you want! Ping @nielsenko on the PR once CI is green and he will take on review.

  8. Metaildust commented on Mar 13, 2026

    @Metaildust
    Author

    Hi @marcelomendoncasoares @nielsenko,

    I wanted to mention something first.

    Initially, I planned to use the current compatibility approach throught s3_compat. However, after doing some research, I realized that it wouldn't achieve perfect compatibility. So instead, I'm going to use the same method that my package currently uses — the official Tencent COS signature approach. This method has been verified in production and is also the recommended way to access Tencent COS.

    While this approach will be heavier, it will achieve perfect compatibility.

  9. Metaildust commented on Mar 13, 2026

    @Metaildust
    Author

    pr: #4846

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: deploymentarea: storage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions