Level 122
As a guess, filesize() needs the path to the file, not just its name.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
$fullname = "pb_LSrdxU.zip";
return response()
->download($fullname, basename($fullname), [
'Content-Length' => filesize($fullname)
])
->deleteFileAfterSend();
HTTP/1.1 200 OK
Date: Fri, 12 Apr 2024 16:45:35 GMT
Server: Apache
Cache-Control: no-cache, public
Content-Disposition: attachment; filename=pb_LSrdxU.zip
Accept-Ranges: bytes
Last-Modified: Fri, 12 Apr 2024 16:45:35 GMT
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/zip
Using Apache, my Content-Length went missing despite not having done any changes. Any idea how to get it back?
Please or to participate in this conversation.