How to upload large file in php - Web Development and Web Design Codes


Send Email to user for Free No Credit Card Required | Now Send Lot's Of Emails To Your Users Daily For Free!
✓ Free Emails Daily | ✓ Drag & Drop Builder | ✓ Beautiful Email Templates | ✓ Mobile Friendly Emails

Monday, March 12, 2018

How to upload large file in php

How to upload large file in php

In php.ini default setting you can't upload large file more than 2MB..when you try you will get some error message like  Warning: POST Content-Length of 281242912 bytes exceeds the limit of 7340032 bytes in Unknown on line 0
Don't Worry if You want to Upload large file like 500MB,750MB 1GB More than 1GB File you need to configure your php.ini ..
just Follow the below step to Upload large file using php
How to upload large file in php
How to upload large file in php
Follow the Below Step :
Go to Your XAMPP Folder and Find out php.ini file and open it using CodeEditor or Notepad..
Upload Large File in php
in this php.ini page we need to change the below values
Now Find out and change the below values
Your Desired size here such as 1000MB.
Maximum allowed size for uploaded files.How big File you want to upload..such as 750M
Maximum size of POST data that PHP will accept.
Maximum execution time of each script, in seconds

Your Complete Changes will be like below.. You can Increase The Value..
//Maximum amount of memory a script may consume (128MB)

//Maximum allowed size for uploaded files.

//Maximum execution time of each script, in seconds
//Note: This directive is hardcoded to 0 for the CLI SAPI

//Maximum size of POST data that PHP will accept.
//Its value may be 0 to disable the limit. It is ignored if POST data reading
//is disabled through enable_post_data_reading.

Note: Restart XAMPP..
Now use The below PHP codes to test..index.php
<h2>Upload and Save image Using PHP MySQL</h2>
<form method="POST" action="" enctype="multipart/form-data">
<input type="file" name="image"/>
<input type="submit" name="submit" value="Upload"/>
 //ini_set to Limiting File Size
 //Targeting Folder 'file' is folder name
  echo 'Your File Successfully Uploaded';
  echo 'Failed to Upload';
That's It friends how to upload large file in php..
please comments and share..
Thank You..

No comments:

Post a Comment

Thank You for Your Comment

Note: Only a member of this blog may post a comment.