Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:
7 w% Y Z3 W4 X( L6 g) K , C7 |0 T6 D7 ]: M
一、后台--全局--上传设置--远程附件--启用远程附件:是+ n& y4 d2 s9 \4 w( ]
; R2 S5 y, ~2 q' J& S4 E1 I这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。, U" `6 z: R& F. E6 u
二、上传data/attachment下面的文件夹到远程空间的根目录下
# ], ?! h6 C9 T! D9 a4 T# F( S* K+ E4 ^$ a+ q" H. |
三。转换数据库的本地附件的数据为远程附件数据
4 z8 }" z: y, Q, J6 K/ ^6 F" P: H& V涉及到的数据库表:+ n3 P% I- z! p4 v) M
pre_forum_attachment
) V0 Y Y, S$ Q3 Bpre_home_pic. P4 }- o. `* H3 `5 y! x3 M' ?$ B3 k
pre_portal_article_title$ k' B U! n1 u' d4 E! H
pre_portal_attachment- ]( t, Q+ w) g* X4 ]
pre_portal_topic_pic: h' f2 _! K; j, p: d, f2 X3 W
在后台--站长--数据库--升级--分别执行如下代码) o M9 P" K* C0 |6 \. i9 ^) ], p* U
1、pre_forum_attachment7 U/ J+ D" S/ h$ r
- update pre_forum_attachment_0 set remote = '1';
1 f5 j3 |! x3 c ?2 P4 ~2 o& l - update pre_forum_attachment_1 set remote = '1';
; g* b5 y" g* q! i# Z% S - update pre_forum_attachment_2 set remote = '1';
/ [+ j' n8 m) K6 c, i) Q7 f - update pre_forum_attachment_3 set remote = '1';
2 |$ M0 r* `% l0 y" Y" h# P - update pre_forum_attachment_4 set remote = '1';
) Y1 O3 c$ r( ]: C - update pre_forum_attachment_5 set remote = '1';0 U( O( p: `! t' ?" t3 c
- update pre_forum_attachment_6 set remote = '1'; q% E" g4 |; W
- update pre_forum_attachment_7 set remote = '1';
2 B2 h, J5 P) T4 H - update pre_forum_attachment_8 set remote = '1';
6 s* \6 j4 C8 e - update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic; k2 J8 [8 a" E, A% l
- update pre_portal_article_title set remote=1;
6 c" W0 L8 M6 u) c - update pre_portal_attachment set remote=1;
5 K) k5 h0 u E2 ]# n0 ~. M - update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:
9 N4 T; ^" ^+ D, Z- P1 I t- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。
/ l+ b! f& m4 Z$ J& _- F |