Solution for uploading files larger than 2 MB in php

Source: Internet
Author: User
Welcome to the Linux community forum and interact with 2 million technical staff to upload files larger than 2 MB in php. Solution: We often upload attachments larger than 2 MB, the default php setting cannot exceed two megabytes. We can modify the php. ini configuration file to change this size

Welcome to the Linux community forum and interact with 2 million technical staff> solution for uploading files larger than 2 MB with php: We often upload attachments larger than 2 MB, the default php setting cannot exceed two megabytes. We can modify the php. ini configuration file to change this size

Welcome to the Linux community forum and interact with 2 million technicians>

Upload with phpGreater2 MB)FileOfSolutionSolution:

We often upload someGreater2 MB attachment, php default settings are not allowedGreaterIf there are two megabytes, we can modify the php. ini configuration.FileTo change the size.

Next let's take a look at thisFileRelated settings:

1. post_max_size = 10 M

The maximum data size for form submission is 10 MB.FileTo limit the size of the submitted data of the entire form.

The limit covers all content submitted by the form. For example, when posting a post, the post title, content, attachments, etc...

2. file_uploads = On

Upload allowed?FileIf it is OFF, you cannot uploadFile.

3. upload_tmp_dir = "D:/APM/PHP/uploadtemp /"

UploadFileCache directory used by the system. If the disk space of this directory is insufficient, you cannot uploadFile.

4. upload_max_filesize = 2 M

Maximum uploadFileSize.FileSingleFile.

The above are some practices. Try again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.