http://ocrsdk.com/documentation/quick-start/work/
I am calling these urls using POSTMAN and works just fine. But in jQuery AJAX I could not figure out the code make those call.
$("form[name='uploader']").submit(function(e) {
e.preventDefault();
var formData = new FormData($(this)[0]);
$.ajax({
type: 'POST',
url: '//cloud.ocrsdk.com/processImage?language=english&exportformat=txt',
beforeSend: function(xhr,settings) {
//i am using application id and password here
xhr.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
return true;
},
crossDomain: true,
data: formData,
processData: false,
success: function(responseData, textStatus, jqXHR) {
console.log(responseData);
},
error: function (responseData, textStatus, errorThrown) {
alert('POST failed.');
}
});
});
These calls dont work at all. Please check
Thanks in Advance!
Comments
3 comments
Please see the following posts concerning using ABBYY Cloud OCR SDK in AJAX:
Does ABBYY Cloud OCR SDK support AngularJS?
How can I directly take an image from a device to send it to ABBYY using Ajax
And pay your attention to the fact that our Cloud OCR SDK service cannot work with data encoded in base64, it is necessary to pass binary data as is.
If the issue is still actual, kindly send to CloudOCRSDK@abbyy.com the logs from the Fiddler debugger (you can download it from www.fiddler2.com) or any of its analogue. The logs should include the headers, request content and the answer. Then We will show them to our developers for clarification of the issue.
You are showing Javascript with nodejs. I have not got my answer properly. If this can be done with AJAX, jQuery not nodejs? If yes what is the issue in my code?
We have not got a ready sample code or instructions for using ABBYY Cloud OCR SDK in jQuery AJAX.
To debug your code we recommend to use any HTTP debugger (for example, Fiddler). If you send the logs to CloudOCRSDK@abbyy.com, we will be able to show them the developers for investigation the issue.
Please sign in to leave a comment.