Answer the question
In order to leave comments, you need to log in
How to serialize information from input type="file"?
There is such pen . When filling out forms, it makes a json file out of their information. But bypasses the input file. Who can tell how to collect information from this field and send it to the server?
Backnd-schik wrote a method for processing the form, it remains only to collect information from the file field.
There is an Article but there for php. I need for C#
Answer the question
In order to leave comments, you need to log in
readAsDataURL
https://developer.mozilla.org/en/docs/Web/API/File...
We take the form with id, myform.
Create an object data = new FormData(document.getElementById('myform'));
And we send this data to the address of the receiving script with some kind of fetch or XMLHttpRequest.
On the side of the receiving script, for example php, the files will come in the $_FILES array.
Don't forget to add name to the inputs
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question