


Using discuz to implement PHP large file upload application example code_PHP tutorial
For those who really need to improve the conditions for uploading forum attachments, you can try to set the parameters mentioned above in php.ini to adapt to the needs of large file uploads. At the same time, don’t forget to set the attachment restrictions in the background of the forum.
There are two main places in the forum where you can limit the size of attachment uploads. The levels from high to low are:
- Post related---attachment type size
- User Group---Attachment Related
At the same time, here is a configuration guide provided by some friends who have successfully uploaded large attachments through http. Of course, due to different server configurations and network conditions, it may not apply to your situation. There may be many places that need to be referenced. Edit:
Open php.ini,
参数 | 设置 | 说明 |
file_uploads | on | 是否允许通过HTTP上传文件的开关。默认为ON即是开 |
upload_tmp_dir | -- | 文件上传至服务器上存储临时文件的地方,如果没指定就会用系统默认的临时文件夹 |
upload_max_filesize | 8m | 望文生意,即允许上传文件大小的最大值。默认为2M |
post_max_size | 8m | 指通过表单POST给PHP的所能接收的最大值,包括表单里的所有值。默认为8M |
说明 | ||
一般地,设置好上述四个参数后,在网络正常的情况下,上传<=8M的文件是不成问题 | ||
但如果要上传>8M的大体积文件,只设置上述四项还一定能行的通。除非你的网络真有100M/S的上传高速,否则你还得继续设置下面的参数。 | ||
max_execution_time | 600 | 每个PHP页面运行的最大时间值(秒),默认30秒 |
max_input_time | 600 | 每个PHP页面接收数据所需的最大时间,默认60秒 |
memory_limit | 8m | 每个PHP页面所吃掉的最大内存,默认8M |
After modifying the above parameters, you can upload large files under normal circumstances allowed by the network
- Warning: Unable to open '\php2' for reading: Invalid argument in e:userweblarksoft.netuploadupfile.php on line 10
is due to PHP’s upload_tmp_dir. The specified directory must be readable and writable
- Parse error: parse error in c:program filesapache groupapachehtdocsmdwebftpfileupload.php on line 14
Parse errors are generally statement problems, such as matching problems like ";", "'", ")", etc.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

This chapter deals with the information about the authentication process available in CakePHP.
