How to return a file in an input type file field?

4

I have an html form that uploads a file and I can save it to a folder. The problem is that now I need to do the reverse operation, and return the file in that same field of type input type file so that the user can edit. Someone can give me a hand, I'll be grateful. I have tried to save in the value of this input and still it will not.

    
asked by anonymous 03.02.2015 / 11:29

1 answer

6

Can not set the value of a input type="file" for security reasons. From the W3Schools :

  

Note: This property is read-only, because of security reasons.

An alternative is to link the file to input with the title "Current file", for example. If it is an image, you could display this image and put the label of input as "Change image".

    
03.02.2015 / 11:50