Using javascript, I have a file in string (got with ajax request).
How to upload it as file to server by another ajax request ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to set the
Content-typerequest header tomultipart/form-dataand play around with the format a little, I wrote this in Plain Ol’ JavaScript ™ but you could easily rework it for a library:EDIT: had my coffee now, so modified it for jQuery (no-library version here):