Answer the question
In order to leave comments, you need to log in
How can I reduce the number of characters in the result when saving an image via base64 to the database?
An example of encoding an image in base64 encoding:
$file = file_get_contents($_FILES['file']['tmp_name']);
base64_encode(file_get_contents($file));
Answer the question
In order to leave comments, you need to log in
What's the point of putting pictures in the database?
you don’t have an audit for seven years ago
Don't base64 encode, store a binary blob. Base64 by itself increases the size by about 30%.
Or generally save pictures to disk, and write only the path to them in the database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question