some one knows how to send a file in an ajax request? my current problem is that i have the URL of the file in a
<input type="file" />
but i don't know how to "load" the file in a variable or js object to can send it to my server
Can someone who has done this help me ? if there is any way to do it with AngularJS it would be great
Well you have two options to do so
by converting to base64 but you can only send a max of 2mb data with it
with form data, convert your data to multipart/form-data to do so you can use form data
var formData = new FormData(); formData.append('file-name', $(file-content);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.