Home >CMS Tutorial >Discuz >How does Discuz support large file uploads? (Plug-in sharing)
This article will share with you the plug-in that enables Discuz to support large file uploads. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
Related recommendations: "discuz Tutorial"
Easily let Discuz support 500M large file uploads in 5 steps
The demo version is discuz-x3.4
Before using this plug-in, please confirm that Discuz has been installed successfully, and thenback up! Back up! Back up! data/template/1_1_forum_post.tpl.php file
Start modifying
Step 1
Find the websitedata/template/1_1_forum_post.tpl.php file and open the file
In order to facilitate modification, it is recommended to use a text editing tool to modify, such as Notepad2,
Download address: http:// file.yiyuen.com/file/download/7235
Step 2
By searching for the keyword "Upload attachment", locate approximately 976 lines,
and then start a new line after the line and insert the following code
<li id="<?php echo $editorid; ?>_btn_bigupload"><a href="javascript:;" hidefocus="true" οnclick="switchAttachbutton('bigupload');"> 大文件上传 </a></li>
The final result is as follows:
Step 3
Continue to search for the keyword "$_G['setting']['pluginhooks']['post_attach_tab_extra" and locate approximately 1064 lines
Then start a new line after the 94b3e26ee717c64999d7867364b1b4a3 and insert the following code
##
<p class="p_opt post_tablelist" unselectable="on" id="<?php echo $editorid; ?>_bigupload" style="display: none;"> <script id="j_yyFileUpload" src="https://www.yiyuen.com/assets/file/api/for-discuz-x3.4-v1.0.js?t=20191212" async></script> </p>The final effect is as follows:
Step 4
Step 5
Verify whether the modification is successful
Create any post or reply operation, enter advanced mode, click the "Attachment" button, the upload window will pop up, confirm that there is the option of "Large file upload"
Select a local file and try to upload it After the upload is successful, the file name and link will be automatically inserted into the editing window Save the submission, and then go to the front desk to view it When you see the above effect, click the link and automatically jump to the Yiyun file download pageFinish.
Modified php file
http://file.yiyuen.com/file/download/17631
More For programming related knowledge, please visit: programming video! !
The above is the detailed content of How does Discuz support large file uploads? (Plug-in sharing). For more information, please follow other related articles on the PHP Chinese website!