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

[Security] Limit attachment size #523

Open
ziaratban opened this issue Oct 14, 2021 · 0 comments
Open

[Security] Limit attachment size #523

ziaratban opened this issue Oct 14, 2021 · 0 comments

Comments

@ziaratban
Copy link

Hi
My users can set up their email server and view the inbox and download attachments.
So to avoid too much space being occupied by a user, I have to limit the size of the attachment in stream mode.

file_put_contents(
    '/my/local/dir/' . $attachment->getFilename(),
    $attachment->getDecodedContent(maxSize:1024 , throwException:true)
);

The above sample code shows that if the attachment file download is more than 1024 B, it will throw an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant