We have a form where we can upload file. We are not able to upload big size files for e.g. > 30 MB.
We have already changed the settings memory_limit, post_max_size and upload_max_filesize to some large number.
But still we get "This web page is not available" error with "Error code: ERR_CONNECTION_RESET" in Chrome . In Chrome we see message like "Uploading %" and after certain %of uploading it throws the error. In short it seems data is itself not posting to action page.
It looks like your upload is being timed out. Try increasing max_input_time in php.ini, ie:
max_input_time = 600
and your php's max_execution_time = ?
http://php.net/manual/en/function.set-time-limit.php
perhaps better to show the code you're using.
For larger file upload use chunk upload.
https://github.com/blueimp/jQuery-File-Upload/wiki/Chunked-file-uploads
Hopefully this will help you.
Related
I know this question has been asked before, but I've gone through all previously described options and I'm wondering if I'm missing an option. I'm trying upload a file through Apache/PHP that is greater than 2.000GB in size. Files smaller than that work fine.
The following php.ini variables are set, and I have restarted Apache to make sure they are in effect:
max_input_vars = 10000
post_max_size = 5000M
upload_max_filesize = 5000M
max_file_uploads = 1000
max_execution_time = 600
max_input_time = 600
memory_limit = 10000M
I am using a javascript uploader, with no filesize limits in the script, and a PHP page to receive the uploaded files, also with no limits in the script. When it fails, it only gives this error message in the javascript console in Chrome and IE: Failed to load resource: net::ERR_CONNECTION_RESET. There are file size limit checks in the javascript and PHP pages, but those errors are never displayed... so I'm thinking it is not even getting the chance to check the file size in either place.
In case anyone hits this 2.0GB limit, the fix for me was that PHP 5.4 did not support uploads greater than 2.0GB. This limit was changed in PHP 5.6: http://php.net/ChangeLog-5.php#5.6.0
Upgrading to PHP 7.0 worked for me!
I want to upload the file to my local server, but only small size files worked, if the file size exceeds certain value, then it can not find the uploaded file.
if (isset($_FILES["fileToUpload"]["tmp_name"])) {
$fileUploaded = move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], "./uploads/".$_FILES["fileToUpload"]["name"]);
} else {
die("Error uploading file. Please contact an administrator");
}
Then I changed the upload_max_filesize and post_max_size in php.ini, restart apache, but the problem still exists, couls you help me on that? thanks so much.
update:
1. only one file will be uploaded.
2. Small-size file like less than 2 MB could be uploaded successfully. I tested an 10 MB file, it failed.
3. I changed the two parameters upload_max_filesize and post_max_size from 2 MB to 100 MB.
So you can see what actual error is being generated try this code
if ( isset($_FILES["fileToUpload"]) ) {
print_r($_FILES);
}
Then look at the [error] array and see what error is actually being reported.
Then check this page in the manual to see what the numbers mean.
Im using BluImp file uploader. Greate little script that I've used forever.
Now I have scoured there forum and cant find anything but after debugging, I believe it is more of a permissions/restrictions/settings problem.
Once the upload has appeared to have finished, an error is returned:
Error: SyntaxError: Unexpected end of input
After debugging it is cause by any functions writing to the server, i.e. file_put_contents, move_upload_file....
The file is 1.47 mb
my additional ini alterations are
max_execution_time = 1600
max_input_time = 1600
post_max_size = 128M
upload_max_filesize = 128M
Can anyone see anything that I dont?
regards
Also I forgot to add that it does not happen to all files just a few
Im confused... I can't seem to upload files in the 2gb range. When i try using curl to send a 1.92gb file to my site (through an API), it doesn't report anything at all, its just blank. When i send a 1kb file, it reports back like it should.
When i try uploading via the upload form, it ends up freezing mid way, around 33%. Although im not sure if only the progress bar has froze or if the actual file upload it self has been suspended. I suspect that only the progress bar has froze because it still says data is being sent even though the progress bar freezes.
My php.ini (yes, its reflected by phpinfo as well):
register_globals = Off
magic_quotes_gpc = Off
post_max_size = 2047M
upload_max_filesize = 2047M
max_execution_time = 25200 ; Maximum execution time of each script, in seconds
max_input_time = 25200 ; Maximum amount of time each script may spend parsing request data
memory_limit = 2048M ; Maximum amount of memory a script may consume (16MB)
short_open_tag = On
My vps doesnt actually have 2gb of ram at its disposal, but does memory_limit really need to be set this high?
How should i go about testing this? I know 400mb files work, i haven't tested anything in between 400mb and 1.92gb
You will need a premium account to test up to 2gb, so here is one you can play with:
User: testreferral
Pass: 1234
http://filefx.com
I dont understand where this problem is arising.
Check for:
Memory limit. Try uploading files above and below the actual memory limit.
Time limit. Aren't your uploads take 7+ hours, are they?
The effective settings. Some setting might be overridden by server/etc settings.
PHP: mysql query skipped/ignored after large file uploads?
Mysql was timing out during the file upload. So the file wasn't showing up in the DB
I'm writing an app that accepts .mp4 uploads.
So I've a 24.3MB .mp4 that is posted to the server, but it fails silently.
The next smallest file I have is a 5.2MB .flv. It's not the file type of course, but file size.
I wonder if anybody could shed some light on this?
P.S. the relevant php.ini entries are as follows:
memory_limit = 256M
upload_max_filesize = 32M
Help!
You should also set post_max_size. Files are sent using HTTP POST.
I wonder if it's encoding-related. Base64 encoding = 33% greater size. 24.3 * 1.33 = 32.4 MB > 32 MB. Try a 23.9 MB file and see if that succeeds
Set error reporting level to E_ALL. Might give you some hint about what's going wrong.
post_max_size is a good idea, also you should check for timeouts. Since uploading larger files takes longer, the webserver might decide it's all taking too long and cancel the request. Check for maximum execution time in php.ini, also check whether there are other server-side time limits (I know of webervers where all tasks are killed after 30 secs. no matter what. An upload might easily take longer than that).
Have you considered using a Flash-Based uploader? This gives you more control over the upload process, and you can display a progress bar during upload (more user-friendly)