On my XAMPP server, copy() and move_uploaded_file() fail to work if any file uploaded via http request is over 30kB even thought the php.ini post_max_size and upload_max_size values are well over 30kB.
$tmpfile = $_FILES['fileupload']['tmp_name'];
$fileExtension = 'txt';
$newfilename = '01234';
if (!move_uploaded_file($tmpfile, "files/" . $newfilename . "." . $fileExtension)) {
echo "Failed to upload.";
} else {
echo 'Uploaded successfully.';
}
And the php.ini looks like:
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize=70M
; Maximum number of files that can be uploaded via a single request
max_file_uploads=20
; Post form size limit
post_max_size=80M
I can't see what I'm doing wrong here, does anyone know how to fix this?
\r\n", $p, get_cfg_var($p), ini_get($p)); }` and also check whether you have something like suhosin installed - it has additional settings to limit the in/output. – VolkerK Feb 16 '15 at 09:35