0
votes

I want to download file that served by my back end using Polymer.
Back end is written on Scala with Play Framework.
Action responsible for serving file is working ( i've tested by entering action path in browser tab).
What i want is to get tis file by core-ajax component.
Maybe i should use something else? I cannot find any hints on the web.

Cheers!

UPDATE: Here is template part of code of component that i'm trying to launch, it is hosted inside of core-pages.

  <template>
        <link rel="stylesheet" type="text/css" href="../stylesheets/main.css">
        <core-ajax
            id="getData"
            url="http://localhost:9000/getResult"
            method="GET"
            handleAs="document"
        ></core-ajax>



        <label>Input id:</label>
        <paper-input value="{{idToView}}" id="idInput" placeholder="id"></paper-input>
       <!-- <paper-button on-tap="{{getResults}}" class="colored" raised>Create a link</paper-button>-->

        <p>
            <paper-autogrow-textarea id="a1">
                <textarea id="t1"></textarea>
            </paper-autogrow-textarea>
        </p>
    </template>
1
It will be tough for folks to help you without seeing code or whatever error you're seeing.acjay
I'm asking about concept of how to do something, and i don't see how my existing code affects answers.partTimeNinja
How do you know that it isn't working? Are you using this in another component, or on your main page (different circumstances)? What do you want to do with the request? StackOverflow is specifically here to solve specific problems with your code... This means all questions will require at least some of your (non-)working code. If you just want to know how to do something, look up the API or on Google. That's what they are for.Fuzzical Logic
I've updated my question. And i've tried to search for API or on Google for info, and didn't found anything, so i've asked where i can read. I just didn't wanted to bother anyone, links will be sufficient. But anyways, thanks for helping.partTimeNinja

1 Answers

1
votes

So to do what i wanted i had to make a downloadable file in server-side and use a

<a href="http://localhost:9000/getResult?id={{idToView}}"> Download file</a>

to download that. No need to use core-ajax