ember.js - Downloading files with Ember app -


i have ember app (built ember-cli). on backend have rails application handles requests. lets api has following routes:

/model — returns list of models

/model/1 — returns model

/model/1/download — returns file

how can force ember app start file download (using /download path) , how can construct link file download within ember app?

  1. if you're going hit endpoint , return file contents, believe you'll need set content disposition header. more details here: force download through js or query

content-disposition=attachment; filename=some.file.name

  1. if linking file directly, use html5 download attribute;

<a href="{{model.download}}" download>download file</a>


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -