WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] function wp_handle_upload (1 post)

  1. davidspan
    Member
    Posted 6 years ago #

    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];
    }

Topic Closed

This topic has been closed to new replies.

About this Topic