curl-and-php
How to post base64 variable like file ?
Date: Sun, 13 May 2012 18:46:24 +0400
//I get pictures from database in base64 format:
$ready_img = 'data:image/jpg;base64,' . $val["image"];
//Then I try to post it to server:
//multipart
$postdata = array(
"data[title]=' . $obj['sp_header'] . ",
"data[category_id]=' . '1147' . ",
"image[1]=' . $ready_img . ";type=image/jpeg;filename=test.jpg ");
$cmd_line = ("h:/curl/bin/curl.exe " . implode(" ", $proxy_data) . " " . implode(" ", $start_data) . " " . implode(" ", $headers_data) . " -F " . implode(" -F ", $postdata) . " " . implode(" ", $cookie_data) . " " .$url_data);
//execute curl
$out = shell_exec($cmd_line);
//But this variant don't work ...
//Please help me
// P.S. save image to file and then post it to server in this case can not be
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2012-05-13