I am developing my first wordpress plugin. It only needs to allow a user to change a logo in a custom template and change a color scheme in the custom template.
I have made an admin options page and now want to add a field to allow a user to upload an image. How can I upload an image to the wp-content/uploads folder. So far, I have this within a table:
<td><input name="logo_image" type="file" id="logo_image" value="" /></td>
Is this the right approach? If so, how do I direct the file to the right folder? Doesn’t wordpress have it’s own way of handling file uploads?
Add this code to your global custom option function.
More info
or
Media uploader in theme and plugin
You can use the inbuilt function of wordpress
This will automatically move the file to the uploads folder
Or
You can write your own
PHP
function.Additional Details can be found here -> WordPress File Upload