• Hello I’m trying to upload image file i have input field:

    echo '
    <form method="POST" action="">
    <input type="file" name="file" size="40" />
    <input class="button-primary" type="submit" name="Save" value="Send" onClick="'. Send(file_get_contents($_FILES['file']['tmp_name']), $_FILES['file']['name']) .'" id="submitbutton" />
    </form>';

    and function:

    function send($bits, $name){
      $upload = wp_upload_bits($name, null, $bits);
    }

    And i’m getting error: Filne name not exist
    whats the problem?

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Uploading file with wp_upload_bits()’ is closed to new replies.