Updating a Static Website

If you need to update a static file (such as a picture, music file, HTML file, or CSS file) on a website, you can upload the static file again. Note that the newly uploaded files in the same path of OBS overwrite the existing files with the same names by default. To avoid file overwriting, you can enable the versioning function of OBS. With versioning enabled, OBS can store multiple versions of a static file. You can quickly search for and restore different versions or restore data in the event of mis-operations or application faults.

Enabling Versioning

  1. Log in to OBS Console.
  2. In the bucket list, click the target bucket to go to the Overview page.
  3. In the Basic Information area, locate Versioning and click Edit to its right. See Figure 1.

    Figure 1 Versioning

  4. Select Enable and click OK to enable versioning for objects in the bucket.

For more information about versioning, see Versioning.

Updating Static Files

  1. Log in to OBS Console.
  2. In the bucket list, click the target bucket to go to the Overview page.
  3. In the navigation tree on the left, click Object.
  4. Click Upload Object, or select the folder where the file to be updated is located and click Upload Object. A dialog box is displayed. See Figure 2.

    Figure 2 Uploading an object

  5. Add the files to be uploaded.

    • The static website files cannot be encrypted for upload.
    • It is recommended that you select Standard for the storage class. If the storage class of static website files is Archive, you need to restore the files first before accessing it. For details, see Restoring an Archive File on OBS.

  6. Click Upload to complete the upload.

    The newly uploaded file with the same name in the same path is displayed as the latest version in the object list. Each time, only the latest version of the file is accessed. In this way, the static website file can be updated.