[Security] Limit attachment size
ziaratban opened this issue · comments
Abolfazl commented
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.