(Follow-up Operation) 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 static website, you can upload this file again. By default, if you upload a new file using the same name as the file you previously uploaded to the same path of OBS, the new file overwrites the previous one. To avoid this problem, you can enable versioning for OBS. A versioned OBS bucket stores static files of multiple versions, so that you can quickly retrieve and restore different versions or restore data in the event of unintended operations or application failures.
Enabling Versioning
- Log in to OBS Console.
- In the bucket list, click the bucket you want to go to the Objects page. In the navigation pane, click Overview.
- In the Basic Information area, find Versioning and click Edit. The Versioning dialog box is displayed, as shown in Figure 1.
- Select Enable and click OK to enable versioning for objects in the bucket.
For more information about versioning, see Versioning.
Updating Static Files
- Log in to OBS Console.
- In the bucket list, click the bucket you want to go to the Objects page.
- Click Upload Object, or go to the folder where the file you want to update is located and click Upload Object. A dialog box is displayed, as shown in Figure 2.
- Add the file to be uploaded.
- Static website files cannot be encrypted for upload.
- It is recommended that you select Standard for the storage class. If you store the static website files in the Archive storage class, you need to restore the files before accessing them. For details, see Restoring an Archive File.
- Click Upload to complete the upload.
The most recently uploaded file with the same name as those previously uploaded ones is displayed as the latest version in the object list. Each time, only the latest version is accessed. This way, the static website file can be updated.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.