Я написал простую систему загрузки, но система загрузки не работает. Я надеюсь, что вы можете помочь мне!
мой php код:
if (isset($_POST['taskAdd'])) {
move_uploaded_file($_FILES['taskFile1']['tmp_name'], '../files/' . $_FILES['taskFile1']['name']);
$stmt = $con->prepare("INSERT INTO tasks (taskFile1) VALUES (:taskFile1)");
$stmt->execute();
header("Location: /index/");
}
сообщение об ошибке:
Warning: move_uploaded_file(../files/login.html): failed to open stream: No such file or directory in C:\xampp\htdocs\functions\taskAdd.php on line 13
Warning: move_uploaded_file(): Unable to move 'C:\xampp\tmp\phpA9F3.tmp' to '../files/login.html' in C:\xampp\htdocs\functions\taskAdd.php on line 13
Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':taskFile1)' at line 1 in C:\xampp\htdocs\functions\taskAdd.php:15 Stack trace: #0 C:\xampp\htdocs\functions\taskAdd.php(15): PDOStatement->execute() #1 C:\xampp\htdocs\tasks\add\index.php(7): include('C:\\xampp\\htdocs...') #2 {main} thrown in C:\xampp\htdocs\functions\taskAdd.php on line 4
HTML ФОРМА:
<form enctype="multipart/form-data" method='post' name='taskAdd'>
<div class="form-group">
<label for="taskFile1">Hochladen1:</label>
<input type="file" class="form-control-file" name="taskFile1" id="taskFile1">
</div>
</form>