Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Upload opens file in write mode #308

Closed
sparchatus opened this issue Apr 15, 2020 · 1 comment
Closed

File Upload opens file in write mode #308

sparchatus opened this issue Apr 15, 2020 · 1 comment
Labels
Milestone

Comments

@sparchatus
Copy link
Contributor

sparchatus commented Apr 15, 2020

When uploading a file it is opened read/write. This causes a permission error when the web server has read only access to the file.

public function addFile($filename)
{
if ($this->filename === null) {
$this->filename = basename($filename);
}
$stream = fopen($filename, 'r+');
if ($stream === false) {
throw new InvalidParamException("Unable to read file '{$filename}'");
}
return $this->addStream($stream);
}

@samdark samdark added the type:bug Bug label Apr 16, 2020
@samdark
Copy link
Member

samdark commented Apr 16, 2020

Looks like a bug. I see no reason to open it for reading in this case.

@samdark samdark added the status:ready for adoption Feel free to implement this issue. label Apr 16, 2020
@samdark samdark added this to the 2.1.10 milestone Apr 20, 2020
@samdark samdark removed the status:ready for adoption Feel free to implement this issue. label Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants