Title: wp upload bits doesn&#039;t work
Last modified: August 20, 2016

---

# wp upload bits doesn't work

 *  [MVGM](https://wordpress.org/support/users/mvgm/)
 * (@mvgm)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/wp-upload-bits-doesnt-work/)
 * 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](http://codex.wordpress.org/Forum_Welcome#No_Bumping), thank you.]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [MVGM](https://wordpress.org/support/users/mvgm/)
 * (@mvgm)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wp-upload-bits-doesnt-work/#post-2896680)
 * 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**
 *  [kmessinger](https://wordpress.org/support/users/kmessinger/)
 * (@kmessinger)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wp-upload-bits-doesnt-work/#post-2896681)
 * 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](http://jobs.wordpress.net)
 *  Thread Starter [MVGM](https://wordpress.org/support/users/mvgm/)
 * (@mvgm)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wp-upload-bits-doesnt-work/#post-2896682)
 * 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [MVGM](https://wordpress.org/support/users/mvgm/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/wp-upload-bits-doesnt-work/#post-2896682)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
