загрузить файл в шаблон wordpress

Я хочу загрузить файл в папку custome в wordpress

<form action="<?php bloginfo('url') ?>/customer-index2" method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="image" id="image"> <textarea rows="4" cols="40" name="text"></textarea> <input type="submit" value="Upload Image" name="upload"> </form> 

if(isset($_FILES['image']) && $_POST['text']){ $file = $_FILES['image']; $text = $_POST['text']; if($file['error'] == 0 && !empty($file['name'])){ $target = 'folder/' .basename($_FILES['image']['name']); if(move_uploaded_file($_FILES['image']['tmp_name'],$target)){ $sql = "INSERT INTO if(isset($_FILES['image']) && $_POST['text']){ $file = $_FILES['image']; $text = $_POST['text']; if($file['error'] == 0 && !empty($file['name'])){ $target = 'folder/' .basename($_FILES['image']['name']); if(move_uploaded_file($_FILES['image']['tmp_name'],$target)){ $sql = "INSERT INTO wz_or (upload,title) VALUES ('$target','$text')"; mysqli_query($con,$sql); echo 'upload success'; }else{ echo 'there was problem for uploading '; } } } (upload,title) VALUES ('$target','$text')"; mysqli_query($con,$sql); echo 'upload success'; }else{ echo 'there was problem for uploading '; } } } (upload,title) VALUES ('$target','$text')"; mysqli_query($con,$sql); echo 'upload success'; }else{ echo 'there was problem for uploading '; } } } это ошибка

(!) Предупреждение: move_uploaded_file (папка / IMG_20170201_095851_589.jpg): не удалось открыть поток: нет такого файла или каталога в C: \ wamp \ www \ 1 \ wp-content \ themes \ daneshtranse \ customer-index2.php в строке 109 Стек вызовов

Расположение функции памяти времени

1 0.0006 359896 {main} () … \ index.php: 0 2 0.0010 361624 require ('C: \ wamp \ www \ 1 \ wp-blog-header.php') … \ index.php: 17 3 0.4274 18675800 require_once ('C: \ wamp \ www \ 1 \ wp-includes \ template-loader.php') … \ wp-blog-header.php: 19 4 0.4438 18941248 include ('C: \ wamp \ www \ 1 \ wp-content \ themes \ daneshtranse \ customer-index2.php ') … \ template-loader.php: 74 5 0.4470 18954856 move_uploaded_file ()

Solutions Collecting From Web of "загрузить файл в шаблон wordpress"