|
|
@ -243,13 +243,10 @@ const sendFile = (toString => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const boundary = `AjaxUploadBoundary${new Date().getTime()}`; |
|
|
|
const boundary = `AjaxUploadBoundary${new Date().getTime()}`; |
|
|
|
xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`); |
|
|
|
|
|
|
|
if (handler.file.getAsBinary) { |
|
|
|
if (handler.file.getAsBinary) { |
|
|
|
|
|
|
|
xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`); |
|
|
|
xhr[xhr.sendAsBinary ? "sendAsBinary" : "send"](multipart(boundary, handler.name, handler.file)); |
|
|
|
xhr[xhr.sendAsBinary ? "sendAsBinary" : "send"](multipart(boundary, handler.name, handler.file)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
xhr.setRequestHeader("Content-Type", "multipart/form-data"); |
|
|
|
|
|
|
|
// xhr.setRequestHeader("X-Name", handler.name);
|
|
|
|
|
|
|
|
// xhr.setRequestHeader("X-File-Name", handler.file.fileName);
|
|
|
|
|
|
|
|
const form = new FormData(); |
|
|
|
const form = new FormData(); |
|
|
|
form.append("FileData", handler.file); |
|
|
|
form.append("FileData", handler.file); |
|
|
|
xhr.send(form); |
|
|
|
xhr.send(form); |
|
|
|