Cant upload large files in the panel (but simple php upload script works)

Hi, I’m trying to upload a file of ~80mb through the panel. This fails (Status 500) and the server response is: {"status":"error","code":2,"message":"The file is missing in file: \/path\/to\/site\/kirby\/vendor\/getkirby\/toolkit\/lib\/upload.php on line: 198"}

My php.ini looks like this (also checked via phpinfo()):
post_max_size = 250M
upload_max_filesize = 250M
memory_limit = 300M
max_execution_time = 300

Panel Uploads work for files smaller than 64mb. Uploads through a simple upload script also work for files larger than 64mb. Only large files uploaded through the panel fail.

My Kirby and Panel versions are 2.5.7

Does anyone have any ideas as to what might cause this?

Maybe you could try updating Kirby to the latest version first (2.5.12) ? And have you tried different browsers?

Thanks for the quick reply. I’ve updated Kirby to 2.5.12 and tried Chrome, as well as Firefox. But unfortunately the problem still persists.

What type of file are you trying to upload?

I want to upload a video. But I’ve also already tried a zip archive with no luck.

If it really stops at 64mb, that sounds rather like uploads are restricted by the hosting provider. Where is your website hosted?

1and1 ionos is the host.

Thats my current guess as well. But I don’t understand why I’m able to upload the same files with the following script, but not with kirby:

test.html

<html>
<body>
<form action="upload.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" /> 
<br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>

upload.php

<?php move_uploaded_file($_FILES["file"]["tmp_name"], "/path/to/site/" . $_FILES["file"]["name"]); ?>
<html>
<head></head>
<body>
<?php
if ($_FILES["file"]["error"] > 0) {
  echo "Error: " . $_FILES["file"]["error"] . "<br />";
} else {
  echo "Upload: " . $_FILES["file"]["name"] . "<br />";
  echo "Type: " . $_FILES["file"]["type"] . "<br />";
  echo "Size: "  .($_FILES["file"]["size"] )." Bytes<br />";
  echo "Temp Storage: " . $_FILES["file"]["tmp_name"];
}
?>
</body>
</html>

It seems to originate when Kirby is trying to move the file after uploading it: https://github.com/getkirby-v2/kirby/blob/a0ab4f5cdaced5bced734bdca9e9cc24f0e473a5/vendor/getkirby/toolkit/lib/upload.php#L130-L143

I had the same issue with 1und1 about two years ago (not with Kirby, but another in-house application) and talked to their support just to find out that it just wasn’t possible to upload any bigger files. We then had to change providers. Don’t understand why your upload script works, then, though.

But I just tested to upload the same 100 mb file in a Kirby installation on an 1und1 server and on another one, and it wasn’t possible on the 1und1 server, but worked on the other server. Max. was indeed around 64mb.

Okay thanks for the quick help so far. I’ll try to contact the 1and1 support tomorrow. In the meantime I confirmed that the simple upload script does indeed work with a ~150mb file. Also I am able to upload large files with kirby on a local server. I can’t really explain this behavior.

I just had a call with the 1and1 support and they confirmed the upload_max_filesize limit of 64M. Me being able to upload larger files with the simple script seems to be bug or maybe even a vulnerability.

Ok, then that’s solved even if it is not really a solution for you and probably means changing your hosting provider.

Yep…