Save file uploaded by user to wordpress uploads folder


Staff member
I have created a page in wordpress and in that i have put this form.

<form action=""method="post"enctype="multipart/form-data">
<input type="file" name="file"><br>
<input type="text" placeholder="Your Name" name="name" />
<input type="submit" name="submit" value="Submit">

Now on clicking submit i want the pic uploaded by user to be saved in folder wp-content/uploads/[posted user name]

Can anyone please help me with the backend processing part in wordpress.I have tried wp_upload_bits,but could nt go with it.

Thanks in advance.