How to store video in Base64 format by PHP

Today, the company"s front-end group said to send the video in Base64 format to the interface and then store it. But I have not done this before for Base64 to store videos without problems, and I have seen that there seems to be no video format in the Http Mine type.
now confused, solve.


The format of

data url is data: [< mediatype >] [; base64], < data > , so you can save videos like this:

data:video/mp4;base64,3bvwAA...
data:video/webm;base64,3bvwAA....
...

video/mp4 , video/webm these are video format mime.

if you don't save the data url format, you can just save the base64-encoded data (that is, the data above).

of course, it may be better to save the original data and transfer it to base64 encoding when outputting it.

Menu