Skip to main content

Web-Based Direct Upload (Presigned URL)

To upload files to OSS from the frontend, use a presigned URL to enable secure direct uploads. The server generates a presigned URL with specific permissions (e.g., PutObject), and the client uploads the file directly to OSS using the signed URL.

Steps:

  1. Create a Bucket Go to Buckets, click Create Bucket, specify a Bucket Name (e.g., static-web-example) and click Create Bucket.
  2. Configure CORS Configure Cross-Origin Resource Sharing (CORS) rules for the bucket using the PutBucketCors API.
  3. Generate a Presigned URL Use AWS S3 SDK on the server to generate a presigned URL with PutObject permission for secure uploads.
  4. Upload via Web Build an HTML form that submits the file directly to OSS using the presigned URL.