At the beginning, many thanks for creating this package. I found it very useful. However, using it I noticed after a while that I ran out of memory on the server when using this package. It turned out that the files created with this package were never deleted. I dealt with this by extending the UploadedBase64EncodedFile class like this:
<?php
declare(strict_types=1);
namespace AppProject;
use Hshn\Base64EncodedFile\HttpFoundation\File as BaseUploadedBase64EncodedFile;
class UploadedBase64EncodedFile extends BaseUploadedBase64EncodedFile
{
public function __destruct()
{
if (file_exists($this->getPathname())) {
unlink($this->getPathname());
}
}
}
I can throw add this as a pull request or it might be worth mentioning in the readme that after using the class you should remember to remove the file from temporary memory so as not to clog up the server memory :)
At the beginning, many thanks for creating this package. I found it very useful. However, using it I noticed after a while that I ran out of memory on the server when using this package. It turned out that the files created with this package were never deleted. I dealt with this by extending the
UploadedBase64EncodedFile
class like this:I can throw add this as a pull request or it might be worth mentioning in the readme that after using the class you should remember to remove the file from temporary memory so as not to clog up the server memory :)