PHP 8.1.33
Preview: imageCapture.php Size: 455 B
/home/jambtst2015/www/ckeditor/capture/imageCapture.php

<?php
		if($_POST["save"]){
			$type = $_POST["type"];
			if($_POST["name"] and ($type=="JPG" or $type=="PNG")){
				$img = base64_decode($_POST["image"]);

				$myFile = "img/".$_POST["name"].".".$type ;
				$fh = fopen($myFile, 'w');
				fwrite($fh, $img);
				fclose($fh);
				echo "http://giraffeng.com/ckeditor/capture/img/".$_POST["name"].".".$type;
			}
		}else{
			header('Content-Type: image/jpeg');
			echo base64_decode($_POST["image"]);
		}
?>

Directory Contents

Dirs: 1 × Files: 3

Name Size Perms Modified Actions
img DIR
- drwxrwxrwx 2024-11-22 17:53:01
Edit Download
4.85 KB lrw-r--r-- 2025-11-03 10:00:52
Edit Download
1.08 KB lrw-r--r-- 2024-11-22 17:53:01
Edit Download
455 B lrw-r--r-- 2024-11-22 17:53:01
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).