Home > CMS Tutorial > Discuz > body text

How does Discuz support large file uploads? (Plug-in sharing)

青灯夜游
Release: 2021-03-12 10:42:49
forward
2899 people have browsed it

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.

How does Discuz support large file uploads? (Plug-in sharing)

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(&#39;bigupload&#39;);">
大文件上传
</a></li>
Copy after login

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

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>
Copy after login
The final effect is as follows:

  • Step 4

Save the file and complete the modification

  • 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 page

Finish.

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!