jeudi 5 novembre 2015

POST Request Receive Files

I'm using Oboe for a client POST request to a server. The server returns a zip file with an attachment disposition, but when testing it nothing happens when it receives the response. Here's the Oboe request:

promiseOboe({
  url: configuration.rootApiUrl + 'pdffile/download/separated',
  method: 'POST',
  body: { pdfs: appState.pdfs }
}).then(function(data) {
  // Should I do something here?
}).catch(function(err){console.log(err)});

Here's the response header:

Access-Control-Allow-Origin: *
Cache-Control:no-cache
Content-Disposition:attachment; filename=Filename.zip
Content-Length:22
Content-Type:application/octet-stream
Date:Thu, 05 Nov 2015 19:27:38 GMT
Expires:-1
Pragma:no-cache
Server:Microsoft-IIS/10.0
X-AspNet-Version:4.0.30319
X-Powered-By:ASP.NET
X-SourceFiles:=?UTF-8?B?QzpcVXNlcnNcc2NvdHRoXERvY3VtZW50c1xBbGxfQ29kZVxFZGl0UGRmU2VydmVyXEVkaXRQZGZTZXJ2ZXJcYXBpXHBkZmZpbGVcZG93bmxvYWRcc2VwYXJhdGVk?=

Am I missing something? Should I do something in the .then() fucntion? Why doesn't the browser receive the files in its standard way of downloading them?

Aucun commentaire:

Enregistrer un commentaire