|
|
@@ -29,8 +29,13 @@ class ResponseFile extends Response
|
|
|
$this->headers['Content-Length'] = 0;
|
|
|
|
|
|
} else {
|
|
|
+ $content_type = mime_content_type($this->file_path);
|
|
|
+ if (empty($content_type)) {
|
|
|
+ $content_type = "application/octet-stream";
|
|
|
+ }
|
|
|
+
|
|
|
$this->headers['Content-Length'] = filesize($this->file_path);
|
|
|
- $this->headers['Content-Type'] = "application/octet-stream";
|
|
|
+ $this->headers['Content-Type'] = $content_type;
|
|
|
$this->headers['Content-Transfer-Encoding'] = "Binary";
|
|
|
$this->headers['Content-disposition'] = 'attachment; filename="' . basename($this->file_path) . '"';
|
|
|
}
|