Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

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

Hello Aeneas,

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

Ihor Didevych
Posts: 0
Joined: Wed Nov 19, 2014 7:55 pm

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

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

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

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

Hi, thats just a variable used in this line

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

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

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

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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

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

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.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

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

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);

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

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

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...

Malgorzata
Posts: 0
Joined: Tue Apr 18, 2017 1:21 pm

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

Hi, is there any documentation on this available now?

Malgorzata
Posts: 0
Joined: Tue Apr 18, 2017 1:21 pm

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

I tried this solution and it doesn't work

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

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

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.

Return to “Issues”