0
 <image id="output" width="300" height="170" />
  <input type="file" name="name" accept="image/*" value="<?php echo 
  $row['image']; ?>">

In this, we will create an input type file where we will upload a profile image but we want to get the image name during the update section so can we get the image name in the input type file using the value tag?

  • I'm not entirely sure I understand you, but do you mean you wish to have a uploaded filename to be displayed in the input field? Has this file been uploaded? – ewokx Feb 14 '22 at 06:55
  • yes I have to get the image name on the input field – Sohang Tyagi Feb 14 '22 at 07:16
  • Yes, you can. Just query the image location and echo it. The way you did, it should work fine. You can show the error if you are having any. – Bip Lob Feb 14 '22 at 07:24
  • 1
    Does this answer your question? [Pre-Populate HTML form file input](https://stackoverflow.com/questions/16365668/pre-populate-html-form-file-input) – CBroe Feb 14 '22 at 07:36
  • the `file` input is read-only. If the value is already stored in the db, use a hidden input for the existing file name – Professor Abronsius Feb 14 '22 at 07:42

0 Answers0