Hi I'm having a hard time figuring out how to upload my image on my raspberry pi directory. I tried the code below but it returns a blank array. Here's my code 这是我的代码
HTML:
<form action="upload.php" class="dropzone text-center" id="left-drop"> </form>
PHP:
<?php
$target_dir = "/var/www/html/image/main";
$target_file = $target_dir . basename($_FILES["image"]["tmp_name"]);
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
if (move_uploaded_file($_FILES["image"]["tmp_name"], $target_file)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "error\n";
}
?>
My raspberry pi permissions:
I initially assumed that you knew the code you were writing allowed anyone to pwn your server, however you
makes me suspect this is not the case. (some hints above about how to start solving the problems)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.