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!

asked 08 Jan '16, 14:43

rx4hvn's gravatar image

rx4hvn
112


Please see the following posts concerning using ABBYY Cloud OCR SDK in 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.

link

answered 08 Jan '16, 21:05

Oksana%20Serdyuk's gravatar image

Oksana Serdyuk ♦♦
1.5k16

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?

(08 Jan '16, 21:20) rx4hvn

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.

(14 Jan '16, 13:45) Oksana Serdyuk ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×160
×2
×2
×2
×1

Asked: 08 Jan '16, 14:43

Seen: 755 times

Last updated: 14 Jan '16, 13:45

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal