<?php
include_once ("../../../config.php");
include_once ("../path.php");

$modelFolder = $_GET["folder"];
$modelPath = $json_instance_path . $modelFolder . '/';

if (!is_dir($modelPath)) mkdir($modelPath, 0755, true);

$request_new_data = file_get_contents("php://input");
$file = fopen($modelPath . $social_preview_file, "wb");
$data = explode(',', $request_new_data);

fwrite($file, base64_decode($data[1]));
fclose($file);

exit();