Has anyone successfully gotten AJAX to work with the mivascript functions for receiving an image?
I am working on a project where I need to use ajax (xhr) to upload.
The code is pretty straightforward:
But it simply fails.
I have verified the paths, the uptest is responding, but its like the image itself just doesn't get passed.
Is it even possible?
FYI: the uptest.mvc contains the standard miva upload functions Miva_ValidateFileUpload and Miva_ProcessFileUpload" but the validation never happens.
I am working on a project where I need to use ajax (xhr) to upload.
The code is pretty straightforward:
Code:
xhr.setRequestHeader("enctype", "multipart/form-data");
xhr.setRequestHeader("Content-Type", "image/jpeg");
xhr.open('POST','https://thesite.com/uptest.mvc');
xhr.send({file: filevar, name: 'thename');
I have verified the paths, the uptest is responding, but its like the image itself just doesn't get passed.
Is it even possible?
FYI: the uptest.mvc contains the standard miva upload functions Miva_ValidateFileUpload and Miva_ProcessFileUpload" but the validation never happens.
Comment