I wanted to create my own widget for uploading images to a server so apparently input[type="file"]
was the way to go. However I also wanted some functionality:
Everything was fine until I stumbled on point 3. from the list above. It turns out that the FileList
object of the file input
is readonly
and you can't do any modifications on it. Thus if I wanted to remove an image I would have to choose all images except this one and overwrite the existing collection of images. So I wanted to know why they made it to be readonly? Are there some security reasons? Thanks.
It seems that you can't do everything in javascript after all, as I was starting to have such observations (lol).