I am writing a widget plugin; and I want to insert an input tag:
<input type="file"> to browse for a pattern in my widget plugin admin panel; but I have problem to save its value(address of the pattern).
It seems that
<input type="file"> doesn't work in widget plugins. Is it correct? Are there any other ways to browse a file from the admin panel?
here is the input file code in the widget form function:
<fieldset id="customize"> <label>Browse pattern:</label> <input type="file" accept="image/*" size="15" id="<?php echo $this->get_field_id('menupattern'); ?>" name="<?php echo $this->get_field_name('menupattern'); ?>" value="<?php echo $instance['menupattern']; ?>" /> </fieldset>
@s_ha_dum, I have been read the link about
enctype ; but it wasn't helpful.
please note that in the widget plugins I have to send data by the widget
form( $instance ) function, and I want to let the user to select a photo from the webserver; not to upload it!