php - Save image from highchart to my local server -
just want save image highcharts local server image saved on image folder when opened says cannot open file here script response is

$('document').ready(function(){ var async = true; var asyncrendering = false; var callback = "<?php echo $callback; ?>"; var constr = "<?php echo $constr; ?>"; var infile = "<?php echo $infile; ?>"; var scale = false; var styledmode = false; var type = "<?php echo $type; ?>"; var width = false; //alert(width); var arr = { async: async,asyncrendering: asyncrendering,callback: callback,constr: constr,infile: infile,scale: scale,styledmode: styledmode,width: width,type: type }; $.ajax({ url: 'http://export.highcharts.com/', type: 'post', data: json.stringify(arr), contenttype: 'application/json; charset=utf-8', datatype: 'json', async: false, success: function(msg) { <?php //get file $content = file_get_contents("http://export.highcharts.com/".msg); //store in filesystem. $fp = fopen("images/image.png", "w"); fwrite($fp, $content); fclose($fp); ?> } }); });
Comments
Post a Comment