Answer the question
In order to leave comments, you need to log in
Simulate file upload to server from JS?
Hello!
My goal is to compose in JS and send a POST request to the server, uploading a file, the contents of which will not be taken from the user's disk, but generated in JS.
I don’t quite understand what should be used for this - xmlhttprequest or is there something more high-level?
PS The specific goal is to applaud an image created on canvas through the VKontakte API.
Answer the question
In order to leave comments, you need to log in
Yes XHR. Form a multipart request.
Only an underwater cobblestone awaits you: you will have to send binary data, and not all browsers can send them with XHR.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question