Store Phpwind remote attachments in OSS

更新时间:
复制 MD 格式

This topic describes how to configure a Phpwind forum to store remote attachments in Object Storage Service (OSS).

Prerequisites

  • You have activated OSS and created a bucket with the public-read permission.

  • You have set up a Phpwind forum. If you have not, go to Simple Application Server Setup and select the corresponding image to quickly build a Phpwind forum server.

Background information

The remote attachment feature allows a website to store user-uploaded attachments directly on a remote storage server, typically by using FTP. This feature is supported by platforms such as Discuz, Phpwind, and WordPress.

The procedures in this topic were tested with Phpwind version 8.7.

Procedure

  1. Log on to your Phpwind site as an administrator and click System Settings to access the administration panel.

  2. In the administration panel, choose .

  3. Click FTP Settings and configure the FTP parameters.

    Parameter

    Description

    Use FTP to upload attachments

    Select Enable.

    Site Attachment URL

    Enter the public endpoint of the bucket in the http://BucketName.Endpoint format. In this example, the bucket is named test-hz-jh-002 and is in the China (Hangzhou) region. Therefore, enter http://test-hz-jh-002.oss-cn-hangzhou.aliyuncs.com. For more information about endpoints, see Access OSS over IPv6.

    FTP Server Address

    The address where the ossftp tool is running. Typically, this is 127.0.0.1.

    FTP Server Port

    The default value is 2048.

    FTP Upload Directory

    Enter a period (.). This specifies that attachment directories are created in the root directory of the bucket.

    FTP Account

    Use the format AccessKey ID/BucketName.

    FTP Password

    Your AccessKey secret.

    Timeout (s)

    The request timeout in seconds. Set this value to 10.

  4. Create a new post to verify the configuration.

    1. When you create the post, upload an image as an attachment. A correctly displayed image confirms that the configuration is successful.

    2. Right-click the image and select Open link in new tab.

      Check the URL in your browser's address bar. A URL containing your bucket name and an OSS endpoint, such as test-hz-jh-002.oss-cn-hangzhou.aliyuncs.com, confirms that the image is stored in OSS.