Hi my problem is still not solved,
I have implemented the cordova FIle upload api,from the plugin "Upload File to Database:
This file uplad gives me a http link like:
https://api.appery.io/rest/1/db/files...');
and I;m using the OCR API: The Call to the API looks like: (Javascript at Button click:)
-------------------------------------------------------------------------------------------------
function uploadFiles(url, files) {
console.log(url, files);
console.log('sending data');
var formData = new FormData();
formData.append('image', files[0]);
formData.append('language', 'en');
formData.append('apikey', 'cCXXXXXXuy');
var xhr = new XMLHttpRequest();
xhr.open('POST', url, true);
Code: Select all
$('.translation_text').text('Translating. Please wait ... ');
xhr.onload = function(e) {
console.log(this.response);
$('.translation_text').text(this.response);
};
}
uploadFiles('http://api.ocrapiservice.com/1.0/rest...', $('input[type="file"]')[0].files);
-------------------------------------------------------------------------------------------------
This solution with "uploadFiles(url, files)
is used to oplad a JPEG file from FILE system of a MOBILE divice,
I want to use the DATABASE URL which looks like:
'https://api.appery.io/rest/1/db/files...'
So the question is how can I replace : $('input[type="file"]')[0].files with
https://api.appery.io/rest/1/db/files...
Actually OCR API wants from me:: Image, Languge and APIKEY,
Language and APIKEY are oke , but what can I do to replace "input file " solution with the http solution like
'https://api.appery.io/rest/1/db/files...'
Thanks,
Ahmet