ajax = true; } } public function postProcess() { error_reporting(E_ALL | E_STRICT); $id_product = Tools::getValue('id_product'); $reference = Tools::getValue('reference'); $delete = Tools::getValue('del', 0); if ($delete == 1) { $filename = Tools::getValue('q'); $path = _PS_UPLOAD_DIR_.$id_product.'/'.$reference.'/'.$filename; if(file_exists($path) && is_file($path)) { if (unlink($path)) { echo Tools::jsonEncode(array('delete' => 1)); exit; } } echo Tools::jsonEncode(array('delete' => 0)); exit; } $path = _PS_UPLOAD_DIR_.'simu/'.$id_product.'/'.$reference; if(!file_exists($path)) { mkdir($path, null, true); } $url = _PS_BASE_URL_.'/upload/simu/'.$id_product.'/'.$reference; $options = array( 'upload_dir' => $path.'/', 'upload_url' => $url.'/', 'image_versions' => array(), //disable thumbnail generation ); $upHandler = new UploadHandler($options); exit; } }