搜索
SR網頁設計工作室 - 購物網站/企業官網專業開發 Discuz 使用教程 Discuz x2.5 本地附件與遠程附件轉換方法
byadmin 發表於 2013-4-23 16:33:17 , 2482人已閱讀 , 0人回應
部分檔案附件量很多或是很大的網站,採用遠程附件是舒緩網站主機壓力的一種優化方式 , 若是您有兩個以上空間的站長 , 並且在主網站流量與容量有限的情況下可以考慮使用此方式 ~  


一、後台 > 全局 >上傳設置 > 遠程附件 > 啟用遠程附件:是
這裡根據後台提示和自己開啟的遠程服務器的FTP的信息配置就可以,要確保FTP具有以下權限:讀取文件、寫入文件、刪除文件、創建目錄、子目錄繼承。

二、上傳data/attachment文件夾到遠程空間的data/attachment路徑下 (路徑名稱要相同)

三。轉換數據庫的本地附件的數據為遠程附件數據
涉及到的數據庫表:
pre_forum_attachment
pre_home_pic
pre_portal_article_title
pre_portal_attachment
pre_portal_topic_pic

在後台--站長--數據庫--升級--分別執行如下代碼
1、pre_forum_attachment 資料表的升級
  1. update pre_forum_attachment_0 set remote = '1';
  2. update pre_forum_attachment_1 set remote = '1';
  3. update pre_forum_attachment_2 set remote = '1';
  4. update pre_forum_attachment_3 set remote = '1';
  5. update pre_forum_attachment_4 set remote = '1';
  6. update pre_forum_attachment_5 set remote = '1';
  7. update pre_forum_attachment_6 set remote = '1';
  8. update pre_forum_attachment_7 set remote = '1';
  9. update pre_forum_attachment_8 set remote = '1';
  10. update pre_forum_attachment_9 set remote = '1';
複製代碼
2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic 資料表的升級
  1. update pre_portal_article_title set remote=1;
  2. update pre_portal_attachment set remote=1;
  3. update pre_portal_topic_pic set remote=1;
複製代碼
3、由於個人相簿中的remote取值還有一種情況為remote=2(論壇附件圖片保存到相簿) pre_home_pic,執行語句:
  1. update pre_home_pic set remote=remote+1;
複製代碼
按照以上操作後,打開網站附件的屬性看看是否已經在遠程空間網址上了,如果顯示正常說明附件搬家到其他空間轉換成功囉 ~

Traffic Exchange Site
您需要登錄後才可以回帖 登錄 | 立即註冊

作者資訊

文章分類

SR數位設計工作室

  • 服務專線:03-3555-069


ECSHOP購物網站開發|接案說明|線上洽詢|隱私權政策|SR數位設計(CMS)

信箱:sr.design2011@gmail.com

, Processed in 0.138094 second(s), 45 queries , Gzip On.

Copyright © 2011-2014 Template By SR網頁設計清新部落風格

Core - DZ2.5 GMT+8, 2024-3-28 22:53

回頂部