title: how to set value in input type = file from database
body: <pre><code>&lt;div class=&quot;modal fade validate&quot; id=&quot;modal-6&quot;&gt;
      &lt;div class=&quot;modal-dialog&quot;&gt;
          &lt;div class=&quot;modal-content&quot;&gt;
              &lt;div class=&quot;modal-header&quot;&gt;
                  &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/button&gt;
                  &lt;h4 class=&quot;modal-title&quot;&gt;Edit Advertisement&lt;/h4&gt;
                  &lt;label class=&quot;idhere&quot;&gt;&lt;?php echo $id; ?&gt;&lt;/label&gt;
              &lt;/div&gt;
              &lt;?php $sel = $d-&gt;select('advertisements', 'ad_id=12');
              while ($result = mysqli_fetch_assoc($sel)) {
              ?&gt;
                  &lt;div class=&quot;modal-body&quot;&gt;
                      &lt;div class=&quot;row&quot;&gt;
                          &lt;div class=&quot;form-group col-md-6&quot;&gt;
                              &lt;label class=&quot;control-label&quot;&gt;Image Upload&lt;/label&gt;
                              &lt;div&gt;
                                  &lt;div class=&quot;fileinput fileinput-new&quot; data-provides=&quot;fileinput&quot;&gt;
                                      &lt;div class=&quot;fileinput-new thumbnail&quot; style=&quot;width: 200px; height: 150px;&quot; data-trigger=&quot;fileinput&quot;&gt;
                                          &lt;img src=&quot;&lt;?php echo $result['photo']; ?&gt;&quot;&gt;
                                      &lt;/div&gt;
                                      &lt;div class=&quot;fileinput-preview fileinput-exists thumbnail&quot; style=&quot;max-width: 200px; max-height: 150px&quot;&gt;&lt;/div&gt;
                                      &lt;div&gt;
                                          &lt;span class=&quot;btn btn-white btn-file&quot;&gt;
                                              &lt;span class=&quot;fileinput-new&quot;&gt;Select image&lt;/span&gt;
                                              &lt;span class=&quot;fileinput-exists&quot;&gt;Change&lt;/span&gt;
                                              &lt;input type=&quot;file&quot; name=&quot;advertise_photo&quot; accept=&quot;image/*&quot;&gt;
                                          &lt;/span&gt;
                                          &lt;a href=&quot;#&quot; class=&quot;btn btn-orange fileinput-exists&quot; data-dismiss=&quot;fileinput&quot;&gt;Remove&lt;/a&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;modal-footer&quot;&gt;
                      &lt;button type=&quot;button&quot; class=&quot;btn btn-info&quot;&gt;Send&lt;/button&gt;
                      &lt;button type=&quot;button&quot; class=&quot;btn btn-white&quot; data-dismiss=&quot;modal&quot;&gt;Close&lt;/button&gt;
                  &lt;/div&gt;
              &lt;?php } ?&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I am unable to set the value of input type=file from database,
  and if the image is exits then change button appear instead of select image.
  when i am choosing new file it works properly,and change and remove button appear instead of select file.
  Please help me to solve it.</p>