6*3600) { unlink($target_dir . $file); } } closedir($handle); } $target_file = $target_dir . basename($_FILES["file"]["name"]); $uploadOk = 0; $fileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); if ($fileType == '' || $fileType == 'php' || $fileType == 'html' || $fileType == 'htm') { $fileType = 'txt'; } $target_file = $target_dir . substr(md5_file($_FILES['file']['tmp_name']), 1, 6) . "." . $fileType; if (file_exists($_FILES["file"]['tmp_name'])) { $uploadOk = 1; } // Check file size if ($_FILES["file"]["size"] > 600000000) { echo "Your file is too large."; $uploadOk = 0; exit; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { //echo "Sorry, your file was not uploaded for an unknown reason."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) { echo "https://" . $_SERVER['HTTP_HOST'] . "/" . $target_file; exit; } else { echo "Sorry, there was an error uploading your file."; } } ?> xfnw's upload thing

xfnw's upload thing

files are regularly automatically deleted, and will probably be gone in 6 hours

# upload function
upload(){ curl -F"file=@$1" https://xfnw.ttm.sh/u.php ; }
upload file.png

# paste function
paste(){ curl -F"file=@-" https://xfnw.ttm.sh/u.php ; }
cat something.txt | paste

# auto upload your screenshots
scrot -e 'curl -F"file=@$f" https://xfnw.ttm.sh/u.php | xclip -selection clipboard'

or