hshn / base64-encoded-file Goto Github PK
View Code? Open in Web Editor NEWProvides handling for base64 encoded files, and the integration of symfony/form
License: MIT License
Provides handling for base64 encoded files, and the integration of symfony/form
License: MIT License
Hi there, we needed this package to support Symfony 6, so I forked and created a PR for you to merge.
Let me know if you need anything else from me for this.
Thanks, Odinn ๐
Hi,
Is it possible to have a SF 4 compatibility ?
Seems to be a problem with symfony/http-foundation
Best regards
The current way it's written only allows Symfony version 3.0.9
"symfony/http-foundation": "~3.0.9|^4.0.4"
You almost certainly want:
"symfony/http-foundation": "^3.0.9|^4.0.4"
Uncaught Error: Class 'Symfony\Component\HttpFoundation\File\MimeType\MimeTypeExtensionGuesser' not found
https://github.com/symfony/symfony/blob/5.1/src/Symfony/Component/HttpFoundation/CHANGELOG.md#430
* deprecated `MimeTypeGuesserInterface` and `ExtensionGuesserInterface` in favor of `Symfony\Component\Mime\MimeTypesInterface`.
* deprecated `MimeType` and `MimeTypeExtensionGuesser` in favor of `Symfony\Component\Mime\MimeTypes`.
* deprecated `FileBinaryMimeTypeGuesser` in favor of `Symfony\Component\Mime\FileBinaryMimeTypeGuesser`.
* deprecated `FileinfoMimeTypeGuesser` in favor of `Symfony\Component\Mime\FileinfoMimeTypeGuesser`.
See: #21
Hi is it possible to update it for Symfony 5 please?
Remove the data part from the string:
data:image/gif;base64,
Due to the use of the ~2.x in composer.json you currently can't install this project within a Symfony3 project.
You could add "|~3.0" to version constraints on Symfony components to fix it (if nothing break).
May do a PR if I got the time.
Need support new version symfony framework
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 :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.