nafeeur10's avatar

How to get Buffer Array Image to Processable Image in Laravel

I have to pass file to Nodejs to Laravel. But Nodejs giving me Buffer Array type Data. Like this:

array:6 [
  "fieldname" => "review_images[0][0]"
  "originalname" => "organic-apple-fruit-500x500.jpg"
  "encoding" => "7bit"
  "mimetype" => "image/jpeg"
  "buffer" => array:2 [
    "type" => "Buffer"
    "data" => array:15066 [
      0 => 255
      1 => 216
      2 => 255
      3 => 224
      4 => 0
      5 => 16
      6 => 74
      7 => 70
      8 => 73
      9 => 70
      10 => 0
      11 => 1
      12 => 1
      13 => 1
      14 => 0
      15 => 72
      16 => 0
      17 => 72
      18 => 0
      19 => 0
      20 => 255
      21 => 219
      ------

Now I need to convert it so that I can handle like the PHP normal file uploading system.

https://stackoverflow.com/questions/30799860/how-to-convert-byte-array-to-image-in-php Followed this. But Not working....

0 likes
0 replies

Please or to participate in this conversation.