Page 3 of 3

Appery.io instructions to generate a pdf from the front end

Posted: Wed Jan 28, 2015 8:48 am
by Evgene Karachevtsev

Hello Aeneas,

We are very sorry for delay, we are working on your request and try to post and update later today.


Appery.io instructions to generate a pdf from the front end

Posted: Wed Jan 28, 2015 6:57 pm
by Ihor Didevych

Hello,

1) For xhr2 you are receiving it as binary
2) Your next line: var request
this object doesn't have anything saying about type


Appery.io instructions to generate a pdf from the front end

Posted: Wed Jan 28, 2015 7:22 pm
by Aeneas McBurney

Hi, thats just a variable used in this line

var XHRResponse = XHR2.send("POST", url, request)


Appery.io instructions to generate a pdf from the front end

Posted: Wed Jan 28, 2015 7:32 pm
by Aeneas McBurney

How should I put type into this variable to pass to next xhr2 request? Aeneas


Appery.io instructions to generate a pdf from the front end

Posted: Fri Jan 30, 2015 5:20 pm
by Alena Prykhodko

Same as you did for GET request including a parameter Content-type inside.
With a proper types, that should be a type of file content, what ever it is.


Appery.io instructions to generate a pdf from the front end

Posted: Fri Jan 30, 2015 6:02 pm
by Aeneas McBurney

The first requestbody is not actually being used in the first request. When I add

"Content-type": "application/png"

to the post requst I still get

{"code":"BCXX002","description":"Cannot consume content type"}

The actual code I am using is.....

var url = "http://api.page2images.com/directlink..."

var XHRResponse = XHR2.send("GET", url);
response.success(XHRResponse.body, "application/text");

var res = XHRResponse.body
console.log(res);

url="https://api.appery.io/rest/1/db/files"

var request = {
"headers": {
"X-Appery-Database-Id": "53bf19xxxxx",
"X-Appery-Master-Key": "e9cfa46xxxxxx",
"Content-type": "application/png"
},
"data": res
};

var XHRResponse = XHR2.send("POST", url, request);

response.success(XHRResponse.body, "text/plain");
console.dir(XHRResponse);


Appery.io instructions to generate a pdf from the front end

Posted: Mon Feb 02, 2015 11:27 am
by Evgene Karachevtsev

Hello Aeneas,

We are very sorry for delay. Could you please instead of sending with xhr2 method of saving in Appery.io db try to use functions designed to work with DB?
http://devcenter.appery.io/documentat...


Appery.io instructions to generate a pdf from the front end

Posted: Thu Apr 27, 2017 10:28 am
by Malgorzata

Hi, is there any documentation on this available now?


Appery.io instructions to generate a pdf from the front end

Posted: Thu Apr 27, 2017 10:32 am
by Malgorzata

I tried this solution and it doesn't work


Appery.io instructions to generate a pdf from the front end

Posted: Thu Apr 27, 2017 12:48 pm
by Illya Stepanov

Hello Malgorzata, this is purely a web client-side JavaScript implementation and the example above was posted 3 years ago. You can use a client-side JS library nowadays for such purposes I believe, please search for appropriate solution in the internet.