Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
php_upload.php
<?php
if($_FILES['file']['name'] != '') {
if($_FILES['file']['error'] > 0) {
echo "错误状态:" . $_FILES['file']['error'];
} else {
$uuid = md5(uniqid(rand(), true));
move_uploaded_file($_FILES['file']['tmp_name'] , "uploads/" . $uuid . ".png");
echo "http://localhost:20001/".$uuid.".png";
}
} else{
echo "请上传文件!";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.