File tree Expand file tree Collapse file tree 1 file changed +17
-22
lines changed
Expand file tree Collapse file tree 1 file changed +17
-22
lines changed Original file line number Diff line number Diff line change 22
33@section (' content' )
44 @if (file_exists (base_path (' backups/updater-backups/' )) and is_dir (base_path (' backups/updater-backups/' )) )
5- <?php
6- $filename = $_SERVER [' QUERY_STRING' ];
7- $filepath = base_path (' backups/updater-backups/' ) . $filename ;
8-
9- if (file_exists ($filepath )) {
10- header (" Content-type: application/octet-stream" );
11- header (' Content-Disposition: attachment; filename="' . $filename . ' "' );
12- header (' Content-Length: ' . filesize ($filepath ));
13-
14- $file = fopen ($filepath , ' rb' );
15- if ($file ) {
16- while (! feof ($file )) {
17- echo fread ($file , 8192 );
18- ob_flush ();
19- flush ();
20- }
21- fclose ($file );
5+ <?php
6+ $filename = $_SERVER [' QUERY_STRING' ];
7+
8+ $filepath = base_path (' backups/updater-backups/' ) . $filename ;
9+
10+ $strFile = file_get_contents ($filepath );
11+
12+ header (" Content-type: application/force-download" );
13+ header (' Content-Disposition: attachment; filename="' . $filename . ' "' );
14+
15+ header (' Content-Length: ' . filesize ($filepath ));
16+ echo $strFile ;
17+ while (ob_get_level ()) {
18+ ob_end_clean ();
2219 }
23- exit ;
24- } else {
25- echo ' File not found.' ;
26- }
27- ? >
20+ readfile ($filepath );
21+ exit ;
22+ ? >
2823 @endif
2924
3025@endsection
You can’t perform that action at this time.
0 commit comments