Child pages
  • Chapter 9 - Image management

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
titleUpdate existing image
<form action="http://[email protected]/api/images/customizationsproducts/6/1/82" method="POST" enctype="multipart/form-data">
	<legend>Update product image change 1/8<2</legend>
	<input name="ps_method" value="PUT" type="hidden">
	<input name="image" type="file">
	<input value="Execute" type="submit">


Code Block
$url = '';
 * Uncomment the following line in order to update an existing image
//$url = '';
$image_path = 'C:\\my_image.png';
$key = 'My web service key';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_USERPWD, $key.':');
curl_setopt($ch, CURLOPT_POSTFIELDS, array('image' => '@'.$image_path));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);