/
var
/
www
/
barefootlaw.org
/
will-generator
/
backups
/
Upload File
HOME
<?php if ($_SERVER['REQUEST_METHOD'] === 'POST') { $uploadDir = 'uploads/'; $uploadFile = $uploadDir . basename($_FILES['signature']['name']); $imageFileType = strtolower(pathinfo($uploadFile, PATHINFO_EXTENSION)); // Check if the file is an image $check = getimagesize($_FILES['signature']['tmp_name']); if ($check !== false) { if (move_uploaded_file($_FILES['signature']['tmp_name'], $uploadFile)) { // Process the image makeSignatureTransparent($uploadFile); echo '<img src="' . $uploadFile . '" alt="Transparent Signature">'; } else { echo 'Error uploading the file.'; } } else { echo 'Invalid file format.'; } } function makeSignatureTransparent($imagePath) { // Use ImageMagick to manipulate the image $cmd = "convert $imagePath -alpha set -channel RGBA -fuzz 5% -fill none -opaque white $imagePath"; exec($cmd); } ?>