0

I notice that the value attributes doesn't make the input file display anything:

<input
  name="floorplan"
  value="file.jpg"
  type="file">

https://jsfiddle.net/fy206y41/

What's the attribute that I need to use so I can see file.jpg even after refresh? (And get overidden if a file is uploaded?

alex
  • 7,111
  • 15
  • 50
  • 77
  • @chalarangelo No, I just want to display the name of the file. – alex Apr 06 '16 at 10:40
  • It is not simple as you imagine.. Read this: http://stackoverflow.com/questions/1696877/how-to-set-a-value-to-a-file-input-in-html – Rayon Apr 06 '16 at 10:42

1 Answers1

1

I'm pretty sure it's not possible to pre-populate a file input, for obvious security reasons. If you want to preview the last image that a user uploaded in this context, you can just load it into the page as an image.