angularjs - How to mention file name and URL while creating Bolb object from byte[] using angular js -


i using angular access rest api return responseentity of byte array return new responseentity<byte[]>(pdf, headers, httpstatus.ok);

my code in front side below got how read pdf stream in angularjs

$http.post("http://localhost/app/report/csd/" + projectid, obj, {responsetype: 'arraybuffer'})             .success(function (data, status, headers, config) {                 var file = new blob([data], {type: 'application/pdf'});                 var fileurl = url.createobjecturl(file);                 $window.open(fileurl);             })             .error(function (err) {                 callback.error(err);             });     },  } 

the file name being set header in rest api , returned response below:

 headers.add("content-disposition", new stringbuilder("inline; filename=\"").append("report.pdf").append("\"").tostring()); 

i want above file name set bolb object, , new window url in address bar should url of post request. hence after $window.open(fileurl) call address bar should display url http://localhost/app/report/csd/{{project_id}} , generated file should of name : report.pdf.

currently url coming blob:http%3a//localhost%3a8080/88506783-779c-4525-bdc3-329029d23257" , file name 88506783-779c-4525-bdc3-329029d23257.pdf how can achieve above please help!


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -