How to save a PNG image server-side, from a base64 data string

后端 未结 15 2339
情话喂你
情话喂你 2020-11-22 03:18

I\'m using Nihilogic\'s \"Canvas2Image\" JavaScript tool to convert canvas drawings to PNG images. What I need now is to turn those base64 strings that this tool generates,

15条回答
  •  不知归路
    2020-11-22 03:31

    It's simple :

    Let's imagine that you are trying to upload a file within js framework, ajax request or mobile application (Client side)

    1. Firstly you send a data attribute that contains a base64 encoded string.
    2. In the server side you have to decode it and save it in a local project folder.

    Here how to do it using PHP

    
    

提交回复
热议问题