Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:
& q7 N9 K+ p/ f' F * I9 F# i& C7 C! O' _1 S% v/ I: m
一、后台--全局--上传设置--远程附件--启用远程附件:是/ {: z7 u' v6 Q
Y$ P# W8 `) n0 V$ Y" V* B: x2 G
这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。
6 t. ^/ G& l- k二、上传data/attachment下面的文件夹到远程空间的根目录下
+ d2 h8 D. D/ P# d* A! Q& [7 C; y1 R6 ^( O" n8 e, w
三。转换数据库的本地附件的数据为远程附件数据' A4 ], S0 `# W% p* x: s
涉及到的数据库表:
C! {2 c* q- q! q' S# ?3 epre_forum_attachment- _+ q9 ~7 p& ?- Q
pre_home_pic
" ^; O0 S1 v: O+ \pre_portal_article_title
0 g: }- P7 x4 A3 L" Zpre_portal_attachment+ S3 |: y* W# R M- }
pre_portal_topic_pic
$ A7 G1 h, ~# P u0 n- j在后台--站长--数据库--升级--分别执行如下代码
7 t7 O+ B# g7 }0 `4 B* U! C1、pre_forum_attachment
; v2 k1 N* x: I$ A, _- update pre_forum_attachment_0 set remote = '1';; a8 z$ V6 ]7 o8 m' B3 C. v& T
- update pre_forum_attachment_1 set remote = '1';
' P$ L+ O0 k: M6 R - update pre_forum_attachment_2 set remote = '1';
! p. L9 i) T# }) ?* S - update pre_forum_attachment_3 set remote = '1';* Q" e `( V- x* a
- update pre_forum_attachment_4 set remote = '1'; F! ~) A r- f* L
- update pre_forum_attachment_5 set remote = '1'; i9 M; p8 i1 Z: D7 s8 C
- update pre_forum_attachment_6 set remote = '1';
: w# @' |, A( _. Z& ^9 B. b, y - update pre_forum_attachment_7 set remote = '1';
, | @3 B& [( |( _ - update pre_forum_attachment_8 set remote = '1';0 j- L$ E6 t8 o h
- update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic7 ?( i% `4 O2 F' d- w; F" h( N
- update pre_portal_article_title set remote=1;6 i8 ]5 {" ^! V; J- w) v
- update pre_portal_attachment set remote=1;6 L& Q; N: ?9 _" J! t7 [* ?0 a
- update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:
. s; J0 ?" M, f- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。4 c2 E" k/ D) g/ L' ]) ^# ^
|