HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //proc/thread-self/cwd/personality-test/save_image.php
<?php


// ini_set('dsiplay_errors', 1);
// error_reporting(E_ALL);

// $json = file_get_contents('php://input');
// $data = json_decode($json);

$testId = $_REQUEST['test_id'];
$image_path = $_REQUEST['image'];
$type = $_REQUEST['type'];
if ($testId != '' && $image_path != '') {

    if ($type == 'bar') {
        $image_name = $testId . '-bar.png';
        $path = '/var/www/selfanalyse/personality-test/chart_images/'.$image_name;
        if (file_exists($path)) {
            echo "exist";
        } else {

            $url = $image_path;
            $img = '/var/www/selfanalyse/personality-test/chart_images/' . $image_name;
            file_put_contents($img, base64_decode($url));
        }
    }
    else if ($type == 'pie-one') {
        $image_name = $testId . '-pie.png';
        $path = '/var/www/selfanalyse/personality-test/chart_images/'.$image_name;
        if (file_exists($path)) {
            echo "exist";
        } else {

            $url = $image_path;
            $img = '/var/www/selfanalyse/personality-test/chart_images/'. $image_name;
            file_put_contents($img, base64_decode($url));
        }
    }
}