The remote attachment feature lets you use FTP to store user-uploaded attachments on a remote server. Many platforms, such as Discuz forums, PHPWind forums, and WordPress sites, support this feature. This topic describes how to store remote attachments from a Discuz forum in OSS.
Prerequisites
-
A bucket with public-read permissions has been created. For more information, see Create buckets.
This topic uses a bucket named test-hz-jh-002 in the China (Hangzhou) region as an example.
-
OSS FTP has been installed. For more information, see Install OSS FTP.
-
A Discuz forum has been set up. To download the software, see Discuz!ᵂ Official Site.
This topic uses Discuz! X3.1 as an example.
Procedure
-
Log on to your Discuz site with an administrator account.
-
On the management page, click Global and then click Upload Settings.
-
Click Remote Attachment and then set the remote attachment parameters.
Parameter
Example value
Description
Enable remote attachment
Yes
Specifies whether to enable remote attachments.
Enable SSL connection
No
Specifies whether to enable the SSL connection.
FTP server address
127.0.0.1
The address where OSS FTP is running. If OSS FTP runs on your local machine, enter 127.0.0.1.
FTP server port
2048
The port that OSS FTP uses to accept access requests. The default port is 2048.
FTP account
Y6IoUOZReouXvWaXuwjvDch9******/examplebucket
The username to connect to OSS FTP. The username consists of the AccessKey ID that has permissions to access the bucket and the bucket name. The format is
AccessKey ID/BucketName. For more information about how to obtain an AccessKey ID, see Create an AccessKey.NoteYou can customize the logon username. For more information, see Create a custom logon user.
FTP password
sRaQg0i3SH9EqYXJSL1hlaR******
The password to connect to OSS FTP. The password is the AccessKey secret that has permissions to access the bucket. For more information about how to obtain an AccessKey secret, see Create an AccessKey.
NoteYou can customize the logon password. For more information, see Create a custom logon user.
Passive mode (PASV) connection
Yes
Select Yes.
Remote attachment directory
.
The path in OSS where the FTP service creates the upload directory for remote attachments. A period (.) indicates that the upload directory is created in the root directory of the bucket.
Remote access URL
https://test-hz-jh-002.oss-cn-hangzhou.aliyuncs.com
The access URL of the bucket. The format is
https://BucketName.Endpoint.FTP transfer timeout
0
Set the value to 0 to use the server's default timeout period.
-
Click Test Remote Attachment to confirm that the configuration is valid.
-
Create a post to verify that the configuration is successful.
-
Upload an image attachment when creating the post.
-
Right-click the image and select Open link in new tab.
If the image URL is in the format
http(s)://BucketName.Endpoint/path/filename, the attachment was uploaded successfully.For example, the image URL in this topic is
https://test-hz-jh-002.oss-cn-hangzhou.aliyuncs.com/forum/201512/18/171012mzvkku2z3na2w2wa.jpg.
-