wp upload bits doesn't 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 pluginthank you all
[No bumping, thank you.]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp upload bits doesn't work’ is closed to new replies.