Download document using Blob.get from javascript client

Hi,
i want to download file using api rest method Blob.get.
I use nuxeo-js-client( nuxeo-js-client) with the method client.operation .
The request download the blob file normally but the file is empty when i try to open it.
Do you have an idea?


Log of request :

Request URL:http://192.168.102.170:9000/nuxeo/site/automation/Blob.Get
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:/
Accept-Encoding:gzip,deflate,sdch
Accept-Language:fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
Authorization:Basic QWRtaW5pc3RyYXRvcjpBZG1pbmlzdHJhdG9y
Connection:keep-alive
Content-Length:99
Content-Type:application/json+nxrequest
Host:192.168.102.170:9000
Nuxeo-Transaction-Timeout:55
Origin:http://192.168.102.170:9000
Referer:http://192.168.102.170:9000/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36 X-NXRepository:default
X-NXVoidOperation:false
X-Requested-With:XMLHttpRequest
Request Payloadview source
{params:{xpath:file:content}, context:{}, input:doc:7412af59-f7ba-40d6-8131-386f467704e8}
Response Headersview source
access-control-allow-credentials:true
access-control-allow-origin:http://192.168.102.170:9000
connection:keep-alive
content-disposition:attachment; filename=file.pdf
content-length:718871
content-type:application/pdf
date:Wed, 09 Jul 2014 14:13:02 GMT
server:Apache-Coyote/1.1
x-ua-compatible:IE=Edge,chrome=1

0 votes

0 answers

964 views

ANSWER