I am writing a custom wordpress plugin that let the user upload a image to a folder. And I'm having problem saving the actual image to a folder.
This is my myplugin.php
add_action( 'admin_menu', 'register_my_custom_menu_page' );
function register_my_custom_menu_page(){
add_menu_page( 'Home Page', 'Home Page', 'manage_options', 'homepage', 'my_custom_menu_page', plugins_url( 'myplugin/images/icon.png' ), 6 );
}
function my_custom_menu_page(){
echo '<h1>Settings</h1>';
echo '<form method="post" action="process.php" enctype="multipart/form-data">';
echo '<table>';
echo '<tr><td>Image 1</td><td><input type="file" name="file1" size="40"></td></tr>';
echo '<tr><td></td><td><input type="submit" name="submit" value="Update" /></td></tr>';
echo '</table>';
echo '</form>';
}
This is my process.php, and I do not see the image inside my wp upload folder. Please help!
move_uploaded_file($_FILES["cul_center"]["tmp_name"], wp_upload_dir().$_FILES["file1"]["name"]);
cul_centerkey is?