0

When I want to update upload image in my form. I can't display previous value. I fetch file name successfully from database. How to show file name in file type attribute in php at the update time Here, I had try to assign value but at validation time this value is taken as null value.

<input type="file" name="image" id="image" value="<?= $row->image ?>" required;>

can we display another string instead of 'No file selected' in file type

1 Answers1

3

You can't set the value of a file element by code for security reasons. Just put a text next to it showing the current uploaded file, and change the label of the file element to something like "Upload new image"

Arne
  • 6,140
  • 2
  • 21
  • 20