Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 112c763

Browse files
morevnaprojectblackwarthog
authored andcommitted
Option to zip downloading files on the fly
So pydio can directly write the zip file to an output stream which is connected to the user's browser without creating any temporary files.
1 parent c5ffd5f commit 112c763

File tree

5 files changed

+164
-43
lines changed

5 files changed

+164
-43
lines changed

core/src/core/classes/class.HTMLWriter.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,11 @@ public static function generateAttachmentsHeader(&$attachmentName, $dataSize, $i
170170
if ($gzip) {
171171
header("Content-Encoding: gzip");
172172
}
173-
header("Content-Length: ".$dataSize);
174-
if ($isFile && ($dataSize != 0)) {
175-
header("Content-Range: bytes 0-" . ($dataSize- 1) . "/" . $dataSize . ";");
173+
if ($dataSize >= 0) {
174+
header("Content-Length: ".$dataSize);
175+
if ($isFile && ($dataSize != 0)) {
176+
header("Content-Range: bytes 0-" . ($dataSize- 1) . "/" . $dataSize . ";");
177+
}
176178
}
177179
header("Content-Disposition: attachment; filename=\"".$attachmentName."\"");
178180
header("Expires: 0");

0 commit comments

Comments
 (0)