How To Change The Maximum File Size Upload? - php

how do you change the maximum upload file size, i want people to only be aloud to upload 25mb video files on my site, can you do that?
like in a .htaccess File But Without Getting A 500 ERROR
UPDATE: http://www.triggervid.com/
when a user uploaded's a video i want it to say Something like - Sorry The file you are trying to upload is to big or it exceeds the maximum limit, only if it is over 25mb. sorry im not very Well At explaining things :)
P.S im using PHP mainly

In your php.ini file you can modify these lines as appropriate:
upload_max_filesize = 10M
post_max_size = 10M

you need to do changes in php,ini file ..
by default for upload_max_filesize, it is 32Mb and for post_max_size it is 16Mb for Apache 2.0 but you an change as per your requirement
upload_max_filesize = desired file size.. (ie 5M)
post_max_size = desired file size.. (ie 5M)
)

Related

Server issue with large file upload?

I have a dedicated server Linux WHM/Cpanel that hosts a video streaming website. I have a form to upload videos and I've been trying to upload larger files but failing? I've checked error logs and nothing is leading me in the right direction. Below are my php.ini settings
upload_max_filesize = 1200M
post_max_size = 1200M
max_input_vars = 1000
memory_limit = -1
max_file_uploads = 20
max_execution_time = 7200
max_input_time = 7200
max_input_vars = 1000
I can upload a 100MB file just fine but the movies i have can be up to 1gb. I'm using Plupload to upload files. I've tested several small size files and they upload fine. When I try to upload large movies e.g. 300mb, Plupload returns this error HTTP Error. Upload URL might be wrong or doesn't exist. and this is the only clue I have. Plupload uses chunking to split up large files also.
This only happens with larger files. It's really a nuisance also, since I have to upload large files all over again to see if my changes are successful or not.
Any ideas? Why would it work with a smaller size file but not larger? I have no errors to work from.
HTTP Error is common when there is something wrong with the files being uploaded. Please check your server info with php.ini
upload_max_filesize is the limit of any single file.
post_max_size is the limit of the entire body of the request,
Sometimes the server requires post_max_size greater than upload_max_filesize I might be wrong but I have to check.
Try debugging the issue removing the chunking first and then later add the chunking part when you remove those HTTP errors.

How to change max upload size for files in Wordpress 4.4 at xampp

I wanted to upload a template to wordpress 4.4 which is running on xampp but it says that I only can upload 2MB. I've googled the problem and found an information that i need to change the parameter upload_max_filesize=32M in the file php.ini. I doesn't found the file in the Wordpress folder but in the xampp folder I found a file called php.ini with the parameter in it and I changed the parameter but nothing happened.
What can I do to increase the max template upload space?
Have you tried this already? http://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/ It contains plenty of ways to increase the max upload size.
Make sure you increase post_max_size and upload_max_filesize, both limits.
So for example in PHP.ini:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
Cause it may take longer to upload those files, you might want to increase max_execution_time as well.
post_max_size is the maximum size for all POST body data. upload_max_filesize is a maximum size only for files that are POSTed. Other types of POST body data are not subject to this limit. See Brad's answer over here: PHP post_max_size vs upload_max_filesize, what is the difference?

Changing Max Upload Size php

I am trying to change the max upload size on my server to allow larger files to be uploaded.
I have gone into the php.ini file, and have changed the following settings:
upload_max_filesize = 20M
post_max_size = 21M
This did not seem to make any difference, as I still can't upload anything bigger than 2MB. Any suggestions would be very helpful.
Thanks

Strange PHP error, where does it come from? Codeigniter

Today i was making a file upload for avatars, everything works great, it resizes the images etc, but occasionally when selecting a large and invalid file it produces this error :
Warning: POST Content-Length of 52091839 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
You did not select a file to upload.
This does not happen all the time, just occasionally. Normally it just gives the correct error message when a file is too big.
Does anyone have an idea where this error comes from, and why it shows?
Thanks!
Sounds like you need to increase post_max_size in php.ini. If you have not already also increased upload_max_filesize, you are likely to need to increase it as well.
# php.ini
# Allow huge files:
# Post usually needs to be bigger than file upload size!
post_max_size = 256M
upload_max_filesize 128M
Update your post_max_size in php.ini to a larger value
upload_max_filesize sets the max file size that a user can upload while post_max_size sets the maximum amount of data that can be sent via a POST in a form. That might be the reason why you get big file error sometimes when you try upload a single file of large size but when you try to upload multiple files the above error is raised.
This has to do with the way the file is coded when uploaded.
Basically it is "seen" as a very large POST.
So you want your php.ini post_max_size larger than your upload_max_filesize value.
Depending on the encoding you use, it should be from 60% to 100% larger.
Otherwise you might have a max file size of 5 M, but this gets encoded to 8.01 M; when that happens, the check for file size passes, but the one for post body size fails. Hence your error.

un-explainable problem with file uploads

Everything was fine with my file upload script until I decided to upload larger files and by larger files am talking about just 2mb talk more of a 30mb file. I have been to my php.ini to change the following:
post_max_size = 100M
upload_max_filesize = 120M
The memory limit was left # d default 128M
after all this settings it still did not work, it shows this error message
"file could not be written to disk"
Some friends suggested that it had something to do with d permissions but I doubt that because the same script works for smaller files 600kb and below. I can't really explain what is going on. Any help would be appreciated.
If linux, check your quota for the user.
Maybe your disk is full.
I had this problem and fixed it by increasing the size of the tmp folder. Check the tmp folder size and make the size is big enough.

Categories