Hôm nay mình download 1 file 3.6Gi on Nextcloud thì bị lỗi.
mình vào log coi thì thấy hú như dưới
TypeError: OC\Streamer::__construct(): Argument #2 ($size) must be of type int, float given, called in /var/www/html/lib/private/legacy/OC_Files.php on line 180
https://github.com/artonge/server/commit/435022515de1983f0fe3d3116acb71a0ed439693
* @param int $numberOfFiles The number of files (and directories) that will * be included in the streamed file */ public function __construct(IRequest $request, $size, int $numberOfFiles){ /** * zip32 constraints for a basic (without compression, volumes nor
Nếu bạn muốn download file trên 4Gi
The issue is with the above 4GB files when using zip
After changing int to float for $size, change the following in the constructor:
if ($size > 0 && $size < 4 * 1000 * 1000 * 1000 && $numberOfFiles < 65536) { $this->streamerInstance = new ZipStreamer(['zip64' => false]); } elseif ($request->isUserAgent($this->preferTarFor)) { $this->streamerInstance = new TarStreamer(); } else { $this->streamerInstance = new ZipStreamer(['zip64' => PHP_INT_SIZE !== 4]);
with this:
if ($size > 0 && $size < 4 * 1000 * 1000 * 1000 && $numberOfFiles < 65536) { $this->streamerInstance = new ZipStreamer(['zip64' => false]); } else { $this->streamerInstance = new TarStreamer(); }
This is a workaround where TAR will be used for above 4GB