BLOB is a binary image. You can write this image to your file system on your server. Therefore, if your image is in the variable $ my_blob, you would do something like
file_put_contents('/path/to/new/file_name', $my_blob);
and there you go.
First you can save the file in the tmp location first, then perform some checks before moving it to the final location (with the PHP rename () function).
Btw: why not just save the blob in DB? Nowadays, this is a legitimate way to process files, which is for all MySQL BLOB data types.
Chris source share