PHPs base 64_decode is not converting base64 string to a real workable image file

后端 未结 4 1591
有刺的猬
有刺的猬 2021-01-28 04:26

Hello guys I successfully found a method that claims to make a file input file into a base 64 string in JavaScript so I successfully sent that base 64

string by JSON v

4条回答
  •  庸人自扰
    2021-01-28 04:47

    Brad indicated a more efficient way, but following your code I see that you keep the string not the result of base64_decode.

    Change

    //Photo upload section
    
    $photo=$upload_info_json_object->photo;
    
    base64_decode($photo);
    

    for

    //Photo upload section
    
    $photo=$upload_info_json_object->photo;
    
    $photo=base64_decode($photo);
    

提交回复
热议问题