We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
Application DistributionAppGallery Connect (HarmonyOS 5 or Later)Open Capabilities of AppGallery ConnectAppGallery Connect APIUpload Management API ReferenceUploading a File

Uploading a File

Function

This API is used to upload a file from your client or server to AppGallery Connect.

HTTPS is used for APIs between the browser or client and the server. The Content-Type header must be in the application/octet-stream format. Files must be encoded in application/octet-stream format and attached to an HTTPS packet.

Currently, this API can upload app packages in APP format (HarmonyOS apps or atomic services).

Callers of this API include account holders, administrators, app administrators, and operations personnel.

Restrictions

  • The file size must not exceed 4 GB for a HarmonyOS app package and 10 MB for an atomic service package, both in APP format.
  • The file name extension must be the same as that in the request in Obtaining the File Upload URL.
  • User profile pictures must be encrypted for storage.

Prototype

Protocol

HTTPS PUT

Direction

Your server -> Huawei server

URL

URL obtained in Obtaining the File Upload URL.

Data Format

Request: Content-Type: application/octet-stream

Response: Content-Type: application/json

Request Parameters

header

Expand

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Authorization information.

This parameter corresponds to Authorization in the headers parameter returned by the API for obtaining the file upload URL.

x-amz-content-sha256

Yes

String

SHA-256 hash value of the file object content.

This parameter corresponds to x-amz-content-sha256 in the headers parameter returned by the API for obtaining the file upload URL.

x-amz-date

Yes

String

File upload URL generation time.

This parameter corresponds to x-amz-date in the headers parameter returned by the API for obtaining the file upload URL.

Host

Yes

String

Address of the server to which the file is to be uploaded.

This parameter corresponds to Host in the headers parameter returned by the API for obtaining the file upload URL.

user-agent

Yes

String

User agent.

This parameter corresponds to user-agent in the headers parameter returned by the API for obtaining the file upload URL.

Content-Type

Yes

String

Object content type.

This parameter corresponds to Content-Type in the headers parameter returned by the API for obtaining the file upload URL.

Body

The request body contains the file content in binary mode. The corresponding Content-Type is application/octet-stream. The file size must be the same as the value of contentLength set when the upload URL is obtained.

Response Parameters

If the API returns the HTTP status code 200, the file is successfully uploaded.

Search in Distribute Apps
Enter a keyword.