Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
c0e67fa2
Commit
c0e67fa2
authored
12 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
fix opening encrypted files from the browser
parent
70cb053e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/files.php
+1
-2
1 addition, 2 deletions
lib/files.php
lib/filesystemview.php
+2
-2
2 additions, 2 deletions
lib/filesystemview.php
with
3 additions
and
4 deletions
lib/files.php
+
1
−
2
View file @
c0e67fa2
...
...
@@ -96,6 +96,7 @@ class OC_Files {
$zip
=
false
;
$filename
=
$dir
.
'/'
.
$files
;
}
@
ob_end_clean
();
if
(
$zip
or
OC_Filesystem
::
is_readable
(
$filename
)){
header
(
'Content-Disposition: attachment; filename="'
.
basename
(
$filename
)
.
'"'
);
header
(
'Content-Transfer-Encoding: binary'
);
...
...
@@ -106,7 +107,6 @@ class OC_Files {
}
else
{
$fileData
=
OC_FileCache
::
get
(
$filename
);
header
(
'Content-Type: '
.
$fileData
[
'mimetype'
]);
header
(
'Content-Length: '
.
$fileData
[
'size'
]);
}
}
elseif
(
$zip
or
!
OC_Filesystem
::
file_exists
(
$filename
)){
header
(
"HTTP/1.0 404 Not Found"
);
...
...
@@ -117,7 +117,6 @@ class OC_Files {
header
(
"HTTP/1.0 403 Forbidden"
);
die
(
'403 Forbidden'
);
}
@
ob_end_clean
();
if
(
$zip
){
$handle
=
fopen
(
$filename
,
'r'
);
if
(
$handle
)
{
...
...
This diff is collapsed.
Click to expand it.
lib/filesystemview.php
+
2
−
2
View file @
c0e67fa2
...
...
@@ -137,9 +137,9 @@ class OC_FilesystemView {
}
public
function
readfile
(
$path
){
@
ob_end_clean
();
$handle
=
$this
->
fopen
(
$path
,
'r'
);
$handle
=
$this
->
fopen
(
$path
,
'r
b
'
);
if
(
$handle
)
{
$chunkSize
=
8
*
1024
;
//
1
MB chunks
$chunkSize
=
8
192
;
//
8
MB chunks
while
(
!
feof
(
$handle
))
{
echo
fread
(
$handle
,
$chunkSize
);
flush
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment