Community

SEND IMAGE BASE64 PHP

Hello

my php code is :

  $post_array = array();

  $post_array["my_file"] = new CURLFile($fileName);

  curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $post_array); 

 

I would like to send the image encoded in base 64. is it possible? If yes, how ?

thank you

0

Comments

1 comment

  • Avatar
    RuskinF

    In PHP, Its very easy to get image file from Base64 encoded. While working with canvas, you will have base64 encoded string in the form, then you will send the form data to the server using POST method and on the server, you convert them into an image file. define('UPLOAD_DIR', 'images/')

    You are using the code in a right way.

    0
    Comment actions Permalink

Please sign in to leave a comment.