• Resolved davidspan

    (@davidspan)


    Could someone point me to an example using wp_handle_upload. I’m tring to use it in my plugin to upload an image and I’m getting an error:
    Invalid form submission.

    This is my code:

    if ($_POST['Submit']=='upload') {
    
    include_once(ABSPATH . 'wp-admin/includes/media.php');
    include_once(ABSPATH . 'wp-admin/includes/file.php');
    $My_file = wp_handle_upload($_FILES[$_POST[image]]);
    
    echo $My_file[error];
    }

  • The topic ‘function wp_handle_upload’ is closed to new replies.