Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
header('Content-type: text/plain; charset=utf-8');
$uploaddir = '/home/akira/public_html/up/';
$id= uniqid();
if(isset($_POST['name']) && (0==preg_match("/[^0-9a-zA-Z]/",$_POST['name']) )){
$id=$_POST['name'];
}
$uploadfile = $uploaddir .$id.".bin";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "http://10.0.1.108/~akira/up/".$id.".bin\n";
} else {
echo "ERROR";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment