Uploading file with wp_upload_bits() (2 posts)

  1. artomal
    Posted 3 years ago #

    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" />

    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.]

  2. artomal
    Posted 3 years ago #

    any idea to catch file via POST method?

Topic Closed

This topic has been closed to new replies.

About this Topic