I suspect your issue is here:
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
I believe this is expecting a String or an Array.
This parameter can either be passed as a urlencoded string like 'para1=val1¶2=val2&...' or as an array with the field name as key and field data as value. If value is an array, the Content-Type header will be set to multipart/form-data. As of PHP 5.2.0, value must be an array if files are passed to this option with the @ prefix. As of PHP 5.5.0, the @ prefix is deprecated and files can be sent using CURLFile.
Consider trying the following:
$dataArray = array( "async" => true, "type" => "image/jpeg", "width" => 800, "options" => $DataEncoded );
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataArray);
Credit to @Patrick Q for catching the Encoding Type. You're not exactly sending it JSON encoded data, but Form data essentially.
I used the recommendations of Twisty and finally I obtain the name of the image, thank you so much.
$dataString = ('async=true&type=image/jpeg&width=800&options='.$DataEncoded); $url ='https://export.highcharts.com/?'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$dataString); curl_setopt($ch, CURLOPT_POST, 1); $headers = array(); $headers = "Accept: application/json"; $headers = "Content-Type: application/x-www-form-urlencoded"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch);
- Obtaining highcharts image URL from PHP
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- How to populate a Highcharts axis with string formatted data from a PHP array
- Highcharts export charts as image on serverside with php
- highcharts change rendered image source on click
- Highcharts multiple series json from php
- Generate image in a folder from Highchart in PHP
- passing json values to highcharts from .net code behind
- How to send json to highcharts from php
- Highcharts series setData from ajax php procedure
- Generating Highcharts from MySQL data with PHP does not work
- Simple, Open source PHP wrapper for Highcharts library
- Passing Returned Data from a PHP Script into a Highcharts data block?
- Highcharts SVG Export from Python Server Side Code
- HighCharts and PHP json_encode. Data from MySQL. No data on chart
- Converted PHP code that built an array to JS and now highcharts doesn't work - what did I do wrong?
- how to make chart real time with 2 line and get data from php with highcharts
- HIGHCHARTS - Jquery/Ajax access php variables from the php file called by ajax
- Plotting multiple series from JSON php import to Highcharts
- Getting numbers on Y-axis to show up as percentages with code from a Highcharts code generator tool?
- Hide the highcharts tracker from image
- Get images from Highcharts PHP Laravel
- Highcharts not being drawn in some cases when using data from MySQL (page elements created before database query complete?) PHP / MySQL
- Replace PHP code in HIGHCHARTS code
- HighCharts pie chart X-axies values are not displayed while trying to get data from MySQL database using PHP
- Bars does not show up when loading JSON encoded data from PHP in Highcharts
- Highcharts format json data from php script / unixtime
- Passing data from PHP array to Highcharts chart with JSON
- Highcharts drilldown json from php mysql
More Query from same tag
- embedded ruby not working in highcharts
- Exporting Highchart To PDF Results in 2 Pages
- HighCharts - Angular, how to get y axis labels on the vertical lines drawn from x axis
- Highcharts : synchronized charts, It's possible export download image all in one?
- Unable To Drilldown With null Value
- how to solve highstocks error #15
- Reset / Set ZoomType Control in Highstock
- how to create donut chart using highcharts?
- Center a chart inside of bootstrap's carousel
- How to change the background color the chart area in high charts?
- Highcharts X axis categories name gets only shows 1 character
- highcharts: change color of pie slice on hover
- highcharts. set full height of column/bar background color
- Converting String to Datetime Rails
- Click event outside series
- Highcharts: render color to series dynamically
- dynamic highchart config in angular ui grid with angular js using pablojim's highcharts ng
- Predictive time modeling for chart
- Passing in Id for each data item in bar chart using highcharts
- Strange result of highchart
- programatically change the color of a highcharts spline series?
- Highcharts - equal spacing between X-axis values having tickPositioner
- Highcharts Barchart Category Word breaks
- xAxis - point specific label positions
- Highstock vs Google Charts in Performance
- HighCharts navigator and range scale not working?
- Append a jQuery variable to a click event handler function
- Highcharts Update Grouped Series Data Point Colors
- Framework for a Business Dashboard - MVC, browser accessible
- Use MySQL data as the chart data for the cakephp highchart plugin