Am trying to trigger an upload box (browse button) using jQuery.
The method I have tried now is:
$(\'#fileinput\').trigger(\'click\');
It is too late to answer but I think this minimal setup work best. I am also looking for the same.
Select your new picture
//css
.btn-file {
display: inline-block;
padding: 8px 12px;
cursor: pointer;
background: #89f;
color: #345;
position: relative;
overflow: hidden;
}
.btn-file input[type=file] {
position: absolute;
top: 0;
right: 0;
min-width: 100%;
min-height: 100%;
filter: alpha(opacity=0);
opacity: 0;
cursor: inherit;
display: block;
}
jsbin
bootstrap file input buttons demo