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/emu-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);

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

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

            $url = $image_path;
            $img = '/var/www/selfanalyse/emu-personality-test/chart_images/' . $image_name;
            file_put_contents($img, file_get_contents($url));
        }
    }
    if ($type == 'cmp-bar') {
        $path = '/var/www/selfanalyse/emu-personality-test/chart_images/'.$image_name;
        if (file_exists($path)) {
            echo "exist";
        } else {

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