• hi
    for a work i create my own page and create a form to send data to database (i create a table for my work in db)
    and i need to upload an image to be shown in page
    i search and find wp upload bits function
    i crate a form and a file input like this:

    <form action="#" method="post">
    <input type="file" name="pic1" />
    </form>

    and with this function try to upload the image.
    this function says:

    $upload = wp_upload_bits($_FILES["pic1"]["name"], null, file_get_contents($_FILES["pic1"]["tmp_name"]));
    foreach($upload as $ali){
    echo $ali.'<br />';
    }

    but this function doesnt work and return an error:
    name is empty
    so i changed the code:

    $upload = wp_upload_bits('ali', null, file_get_contents($_FILES["pic1"]["tmp_name"]));
    foreach($upload as $ali){
    echo $ali.'<br />';
    }

    but it doesn’t work again
    and return an error (i think: the plugin is wasted)

    it isn’t important for me to just use this function
    i just want to upload an image to wp folders without any plugin

    thank you all

    [No bumping, thank you.]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter MVGM

    (@mvgm)

    i asked this question 5days ago

    i search about this question a lot of times
    but no body write about this problem

    THIS IS A WORDPRESS FUNCTION PROBLEM
    I DO ANYTHING LIKE WORDPRESS FUNCTION EXAMPLE

    PLEASE HELP ME

    This is a forum with volunteer helpers who, when they see a post they may know something about, attempt to help.

    Nobody so far who might be able to answer your question has seen your post.

    So, stop using all caps and bold which is screaming and if it is that important consider hiring some help, http://jobs.wordpress.net

    Thread Starter MVGM

    (@mvgm)

    Do you know or want to fix this problem?

    YES?
    I’m be happey to know your answer

    NO?
    you can skip this post 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp upload bits doesn't work’ is closed to new replies.