Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:
/ @; M$ ]7 r5 N) [/ j3 s3 u. A
% D! X) _" ?! k- a9 M# X一、后台--全局--上传设置--远程附件--启用远程附件:是
9 |0 _! H7 R3 H
4 C: o2 y, Z6 `" [& P% f这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。# {* P2 n* \8 E" p4 ?
二、上传data/attachment下面的文件夹到远程空间的根目录下5 w8 d, p9 ]1 s) h
- v7 C; l1 C/ ^, F三。转换数据库的本地附件的数据为远程附件数据
- l. U! w+ x: g. H涉及到的数据库表:" B5 f- P/ W1 G( Z( l- p; b
pre_forum_attachment) ]0 n; i( ~2 I: {2 S% i2 E" `
pre_home_pic
# ^: w5 y0 x+ m( g+ ?pre_portal_article_title
" t* O$ A& V+ P( L4 ]4 m9 V# Zpre_portal_attachment) @! D/ L8 w7 I% n
pre_portal_topic_pic0 D, _% _, r! o
在后台--站长--数据库--升级--分别执行如下代码4 ` X+ D+ ?! q. M+ |/ K
1、pre_forum_attachment! H' i/ K6 z& j9 W U; k$ o
- update pre_forum_attachment_0 set remote = '1';
9 e, H! X, l9 ~& W# g, }6 Q - update pre_forum_attachment_1 set remote = '1';5 J: p& v8 x, V- u
- update pre_forum_attachment_2 set remote = '1';- N! E2 e3 ]) M2 Q+ K
- update pre_forum_attachment_3 set remote = '1';; v- q% @2 u7 T# c6 g. ^1 s
- update pre_forum_attachment_4 set remote = '1';
+ B1 Q: y& @1 {; s - update pre_forum_attachment_5 set remote = '1';4 i, w/ Q! c% e6 f3 y6 `4 j0 g
- update pre_forum_attachment_6 set remote = '1';
' u6 L# j3 W& T+ _% S" W - update pre_forum_attachment_7 set remote = '1';7 c7 u/ K3 @& F& F
- update pre_forum_attachment_8 set remote = '1';
6 `5 f0 v8 z7 f: b+ C" T+ G - update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic
, @: P/ q0 a$ B) |- update pre_portal_article_title set remote=1;7 y$ w- |6 |) Z" m) L+ F
- update pre_portal_attachment set remote=1;; t- S9 k4 l3 C: f4 t! I1 K# ]
- update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:! I9 T* M7 @7 \) i7 M1 g) j, ~; Z
- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。6 S& \. R% b( C* R
|