JS Upload file to HTML File Element preserving the effects of a regular click JS Upload file to HTML File Element preserving the effects of a regular click

How can I use javascript to upload an image to a specific HTML file element (for example, the dropzone on images.google.com)?

I have tried doing

fileElement.files = [myFile];

But that just uploads my file to the specific HTML file element, without triggering the normal effect of uploading to that file element (for example, triggering the actual google search of the image)



from Stackoverflow

Comments

Popular posts from this blog

\\u0000 cannot be converted to text error \\u0000 cannot be converted to text error

How to create @click on select menu in VueJS How to create @click on select menu in VueJS

Using Ts-Standard linting, JSDoc comment at beginning of file triggers "This rule requires the `strictNullChecks` compiler option" error Using Ts-Standard linting, JSDoc comment at beginning of file triggers "This rule requires the `strictNullChecks` compiler option" error