0

I've got a page where you can chainge an image, but I can't find any way to preset the current one (that is currently being hosted on the site).

I was thinking it could work like this:

<input type='file' value='thesite.com/image.jpg'>

But it doesn't show that any file is or could be selected. Is it even possible? Any help would be appreciated.

user15055153
  • 25
  • 1
  • 5
  • Consider trying to change your avatar on any site you belong to. Typically, the current image is shown (as an img) and a button is given to change the current image. The button brings up a file-picker. If a new image is chosen, the preview image is changed. A file-picker is for local-files only. – enhzflep Jun 04 '21 at 21:02

1 Answers1

0

I think the only way is to create a img tag nearby like answered there:

Preview an image before it is uploaded

Lrazerz
  • 164
  • 6
  • So the solution is: Only show a preview, with an option to chainge it. If another is set, chainge the preview-image to it. To check if a new image was selected is to check if the post request doesn't chainge is to check for the image part, or the input with a file that doesn't have a name, right? – user15055153 Jun 04 '21 at 21:19